Add a value with the specified key that does not already exist. Will fail if the key/value pair already exist.
add key value expiryWhere:
key (binary) -
Document ID used to identify the value
value (binary) -
Value to be stored
expiry (numeric) -
Expiry time for key
Java (spymemcached)
client.add(key, expiry, value)
Returns: Future<Boolean> (
Asynchronous request value, as Boolean
)
client.add(key, expiry, value, transcoder)
Returns: Future<Boolean> (
Asynchronous request value, as Boolean
)
client.add(key, expiry, value, persistto)
Returns: OperationFuture<Boolean> (
Asynchronous request value, as Boolean
)
client.add(key, expiry, value, replicateto)
Returns: OperationFuture<Boolean> (
Asynchronous request value, as Boolean
)
client.add(key, expiry, value, persistto, replicateto)
Returns: OperationFuture<Boolean> (
Asynchronous request value, as Boolean
)
memcached text protocol
add key flags expiry value_length
Returns: binary-string (
Binary object
)
add key flags expiry value_length noreply
Returns: binary-string (
Binary object
)
Perl (Cache::Memcached::libmemcached)
$object->add($key, $value [, $expiry ])
Returns: (
Binary object
)
Ruby (Fauna)
object.add(key, value, options)
Returns: fixnum (
The CAS value for the object stored. A fixed number
)
PHP (Couchbase PHP SDK)
$object->add($key, $value [, $expiry ] [, $persistto ] [, $replicateto ])
Returns: scalar; supported values:
$object->addByKey($master_key, $key, $value [, $expiry ])
Returns: scalar (
Binary object
)
Python
object.add(key, expiry, flags, value)
Returns: object (
Binary object
)