Search:

Search all manuals
Search this manual
Manual
Couchbase Client Library: Python 1.0
Community Wiki and Resources
Download Client Library
Python Client Library
SDK Forum
Additional Resources
Community Wiki
Community Forums
Couchbase SDKs
Parent Section
6 Update Operations
Chapter Sections
Chapters

6.4. Delete Methods

The delete() method deletes an item in the database with the specified key. Delete operations are synchronous only.

API Callobject.delete(key [, casunique ] [, vbucket ])
Asynchronousno
Description Delete a key/value
Returnsobject; supported values:
 COUCHBASE_ETMPFAILTemporary failure; try the operation again 
 COUCHBASE_KEY_ENOENTRequested document ID does not exist 
 COUCHBASE_NOT_MY_VBUCKETThe command was sent to the wrong server; may be triggered during a rebalance or failover operation. Retry the operation 
 COUCHBASE_NOT_STOREDThe object was not stored 
 docidDocument ID of deleted document 
Arguments 
key Document ID used to identify the value
int casunique Unique value used to verify a key/value combination
String vbucket Name of the vBucket to be used for storage.

For example, to delete an item you might use code similar to the following:

couchbase.delete("samplekey");