Couchbase C Client  2.4.8
Key-Value API

Detailed Description

Operate on one or more key values.

The key-value APIs are high performance APIs utilizing the memcached protocol. Use these APIs to access data by its unique key.

These APIs are designed so that each function is passed in one or more "Command Structures". A command structure is a small structure detailing a specific key and contains options and modifiers for the operation as it relates to that key.

All the command structures are currently layed out like so:

{
int version;
union {
struct CMDv0 v0;
struct CMDv1 v1;
} v;
}

These top level structures are wrapper structures and are present to ensure portability between different versions of the library. To employ these structures within the command, you may do:

lcb_get_cmd_t gcmd_wrap = { 0 }, *cmdp_wrap = &gcmd_wrap;
lcb_GETCMDv0 *gcmd = &gcmd_wrap->v.v0;
gcmd->key = key;
gcmd->nkey = strlen(key);
lcb_get(instance, cookie, 1, &gcmd_wrap);

Modules

 Get items from the cluster
 Get one or more keys from the cluster.
 
 Get items from replica
 Get items from replica.
 
 Unlocking items.
 See Get items from the cluster.
 
 Storing items
 Mutate an item within the cluster.
 
 Arithmetic/Counter operations
 Atomic counter operations.
 
 Inspect item's Replication and Persistence
 Determine if an item exists and if it has been replicated and persisted to various nodes.
 
 Remove items from the cluster
 Delete items from the cluster.
 
 Modify an item's expiration time
 Modify an item's expiration time, keeping it alive without modifying it.
 
 Ensure a key is replicated to a set of nodes
 The lcb_durability_poll() is used to wait asynchronously until the item have been persisted and/or replicated to at least the number of nodes specified in the durability options.