| API Call | object.Remove(key) | ||
| Asynchronous | no | ||
| Description | Delete a key/value | ||
| Returns | Object; supported values: | ||
COUCHBASE_ETMPFAIL | Temporary failure; try the operation again | ||
COUCHBASE_KEY_ENOENT | Requested document ID does not exist | ||
COUCHBASE_NOT_MY_VBUCKET | The command was sent to the wrong server; may be triggered during a rebalance or failover operation. Retry the operation | ||
COUCHBASE_NOT_STORED | The object was not stored | ||
docid | Document ID of deleted document | ||
| Arguments | |||
string key | Document ID used to identify the value | ||
The Remove() method deletes an item in
the database with the specified key.
Remove the item with a specified key
client.Remove("Budweiser");| API Call | object.ExecuteRemove(key) | ||
| Asynchronous | no | ||
| Description | Delete a key/value | ||
| Returns | IRemoveOperationResult (
Remove operation result
) | ||
| Arguments | |||
string key | Document ID used to identify the value | ||
The ExecuteRemove() method deletes an
item in the database with the specified key and returns an
instance of an IRemoveOperationResult.
var result = client.ExecuteRemove("Coors"); if (!result.Success) { if (result.InnerResult != null) { logger.Error(result.Message, result.InnerResult.Exception); } }