Increment the value of an existing numeric key. Couchbase Server stores numbers as unsigned numbers, therefore if you try to increment an existing negative number, it will cause an integer overflow and return a non-logical numeric result. If a key does not exist, this method will initialize it with the zero or a specified value.
incr key offsetWhere:
key (binary) -
Document ID used to identify the value
offset (binary) -
Integer offset value to increment/decrement (default 1)
Perl (Cache::Memcached::libmemcached)
$object->incr($key [, $offset ])
Returns: (
Binary object
)
Ruby (Fauna)
object.increment(key [, offset ] [, ruby-incr-decr-options ])
Returns: fixnum (
Value for a given key. A fixed number
)
PHP (Couchbase PHP SDK)
$object->increment($key [, $offset ] [, $create ] [, $expiry ] [, $initial ])
Returns: scalar; supported values:
memcached text protocol
incr key offset
Returns: binary-string (
Binary object
)
Java (spymemcached)
client.incr(key, offset)
Returns: long (
Numeric value
)
client.asyncIncr(key, offset)
Returns: Future<Long> (
Asynchronous request value, as Long
)
client.incr(key, offset, default)
Returns: long (
Numeric value
)
client.incr(key, offset, default, expiry)
Returns: long (
Numeric value
)
.NET Client Library
object.Increment(key, defaultvalue, offset)
Returns: CasResult<ulong> (
Cas result of bool
)
object.Increment(key, defaultvalue, offset, validfor)
Returns: CasResult<ulong> (
Cas result of bool
)
object.Increment(key, defaultvalue, offset, expiresat)
Returns: CasResult<ulong> (
Cas result of bool
)
object.Increment(key, defaultvalue, offset, casunique)
Returns: CasResult<ulong> (
Cas result of bool
)
object.Increment(key, defaultvalue, offset, validfor, casunique)
Returns: CasResult<ulong> (
Cas result of bool
)
object.Increment(key, defaultvalue, offset, expiresat, casunique)
Returns: CasResult<ulong> (
Cas result of bool
)
object.ExecuteIncrement(key, defaultvalue, offset)
Returns: IMutateOperationResult (
Mutate operation result
)
object.ExecuteIncrement(key, defaultvalue, offset, validfor)
Returns: IMutateOperationResult (
Mutate operation result
)
object.ExecuteIncrement(key, defaultvalue, offset, expiresat)
Returns: IMutateOperationResult (
Mutate operation result
)
object.ExecuteIncrement(key, defaultvalue, offset, casunique)
Returns: IMutateOperationResult (
Mutate operation result
)
object.ExecuteIncrement(key, defaultvalue, offset, validfor, casunique)
Returns: IMutateOperationResult (
Mutate operation result
)
object.ExecuteIncrement(key, defaultvalue, offset, expiresat, casunique)
Returns: IMutateOperationResult (
Mutate operation result
)
Python
object.incr(key [, offset ] [, defaultvalue ] [, expiry ])
Returns: object (
Binary object
)