|
Couchbase C Client
3.3.19
Asynchronous C Client for Couchbase
|
Set the value of a document.
| lcb_STATUS lcb_cmdstore_on_behalf_of | ( | lcb_CMDSTORE * | cmd, |
| const char * | data, | ||
| size_t | data_len ) |
| lcb_STATUS lcb_cmdstore_on_behalf_of_extra_privilege | ( | lcb_CMDSTORE * | cmd, |
| const char * | privilege, | ||
| size_t | privilege_len ) |
| typedef struct lcb_RESPSTORE_ lcb_RESPSTORE |
Schedule a single storage request.
| instance | the handle |
| cookie | pointer to associate with the command |
| cmd | the command structure |
Operation-specific error codes include:
For a 6.5 or later cluster, you should use the lcb_cmdstore_durability to make the lcb_store not return until the requested durabilty is met. If the cluster is an older version, you can use lcb_cmdstore_durability_observe.
| enum lcb_STORE_OPERATION |
Values for lcb_CMDSTORE::operation.
Storing an item in couchbase is only one operation with a different set of attributes / constraints.
| Enumerator | |
|---|---|
| LCB_STORE_UPSERT | The default storage mode. This constant was added in version 2.6.2 for the sake of maintaining a default storage mode, eliminating the need for simple storage operations to explicitly define lcb_CMDSTORE::operation. Behaviorally it is identical to LCB_STORE_UPSERT in that it will make the server unconditionally store the item, whether it exists or not. |
| LCB_STORE_INSERT | Will cause the operation to fail if the key already exists in the cluster. |
| LCB_STORE_REPLACE | Will cause the operation to fail unless the key already exists in the cluster. |
| LCB_STORE_APPEND | Rather than setting the contents of the entire document, take the value specified in lcb_CMDSTORE::value and append it to the existing bytes in the value. |
| LCB_STORE_PREPEND | Like LCB_STORE_APPEND, but prepends the new value to the existing value. |