0

Assuming i have an existing couchdb JSON document hosted on the server. And i want to add some data to that document using PUT how can i do that ? Lets say the document has the following data already :

"users : [{"name" : "John","lastname" : doe"}]

I want to add another user:

"users : [{"name" : "jane","lastname" : doe"}]

Can this be done with curl and PUT ? assuming i get the doc id of the document from the server and do something like :

curl -X PUT -d $new http://127.0.0.1:5984/database/$documentid" 

I tried the above which failed. So was wondering if there is a way to update couchdb documents by adding new stuff.

1 Answer 1

2

You can use "update handler functions" to do partial updates of documents.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.