How to do partial update of a document

后端 未结 2 1428
借酒劲吻你
借酒劲吻你 2020-12-02 01:40

I need a guidance on how can I update a field in CouchDB. I tried curl via console it works fine but programatically. I don\'t understand how to update a particular field sa

相关标签:
2条回答
  • 2020-12-02 02:10

    It is possible to support partial updates by writing your own update function.

    To be clear, it not actually a truly partial update. It still update the whole target document into new revision. But the update was done directly on the database itself. And so you could specified update partially on client side instead of retrieving and sending the whole document

    0 讨论(0)
  • 2020-12-02 02:13

    Partial updates are not supported by CouchDB. In other words, to update a field in the document, you must update the field in your local JSON document and push that document to CouchDB as a whole.

    You can accomplish this by still issuing an HTTP PUT, ensuring the appropriate _rev is included in your document.

    More details are available in the wiki.

    0 讨论(0)
提交回复
热议问题