how to execute update operation in couchdb in java programme

元气小坏坏 提交于 2019-12-13 08:02:18

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!