store


Description:

public bool store (StoreMode mode, string key, string value, time_t expires = -1)

Store a string value in the bucket.

Example:

  // Add a new key
var success = client.store( StoreMode.ADD, "my-key", "example" );
if (success) {
// This will fail
success = client.store( StoreMode.ADD, "my-key", "example2" );
}
// Add a key with expiration 30 seconds from now
success = client.store( StoreMode.ADD, "my-expiring", "example", ( time() + 30 ) );

Parameters:

mode The StoreMode for this action: ADD, REPLACE, or SET
key The key
value The value
expires Optionally, the unix timestamp when the key expires

Returns:

true if the key/value pair was stored successfully