问题
In my application I am using couchdb for storage. I want to execute update operation in which the _rev value must be change. so kindly help me what i have to do in my java program.
回答1:
The code for reading, modifying and then saving a document is:
Document doc = db.getDocument("documentid1234");
doc.put("foo","bar");
db.saveDocument(doc);
The doc
object will contain the _rev
from when the document was read with the getDocument()
call.
You don't generate the _rev value, couch does.
来源:https://stackoverflow.com/questions/28402979/how-to-execute-update-operation-in-couchdb-in-java-programme