Sets a docId when the document doesn't contain an _id attribute. Then does a PUT request to the db and the docId with the options as params and the doc as body.
A saved document with an ID.
ID and revision of the saved document.
db.save(doc, {"batch" : "ok"})
Does a GET request to the db and the docId with the options as params.
The document, or null when the document doesn't exist.
db.open("123", {"revs" : "true"})
Does a DELETE request to the db and the docId with the revision as param. The current revision of the document has to be specified, otherwise the request results in a 409 error.
The document is deleted (that means the document has the "deleted":true attribute).
ID and revision of the deleted document.
db.deleteDoc({_id : "123", _rev : "1-04d86233b3254bb5a53dcf7103f97fc2"})
Does a DELETE request to the db and the docId and the attachment_name with the revision as param. The current revision of the document has to be specified, otherwise the request results in a 409 error.
The attachment is deleted, the document stays intact otherwise.
ID and revision of the document whose attachment has been deleted.
db.deleteDocAttachment({_id : "123", _rev : "1-04d86233b3254bb5a53dcf7103f97fc2"}, "attachment.txt")
Sets a docId in each document when it doesn't contain an _id attribute. Then does a POST request to the db and _bulk_docs with the docs and the options as body.
All the documents are saved with an ID.
An array with an element for each document that contains ID and revision of the document.
doc1 = {"foo":"bar"}
doc2 = {"foo":"baz"}
db.bulkSave([doc1, doc2])