Tech C**P
15 subscribers
161 photos
9 videos
59 files
304 links
مدرس و برنامه نویس پایتون و لینوکس @alirezastack
Download Telegram
In order to remove a specific document in couchDB, you just need to give delete function the document itself:
couch = couchdb.Server('http://SERVER_IP:PORT/')
your_db = couch['your_db_name']

# we assume you have fetched your_couch_db_doc document
your_db.delete(your_couch_db_doc)

Use this method in preference over __del__ to ensure you're deleting the revision that you had previously retrieved. In the case the document has been updated since it was retrieved, this method will raise a ResourceConflict exception:
>>> db.delete(doc) # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
...
ResourceConflict: (u'conflict', u'Document update conflict.')

#couchdb #couch #delete #remove #document #python