CouchDB Update Document
Update (edit) document using fauxton
Open the Fauxton url:http://127.0.0.1:5984/_utils/
You can also update/ change/ edit your document once you created. Click on the edit option (encircled in red).
After clicking, you will get a new page where you can edit your entries. After editing click on the save changes tab and your document will be updated.
For example: In the below example employee name is Ajeet Kumar, Age is 27 and address is Delhi.
Now, update the name Ajeet Kumar to Sonoo Jaiswal and address Delhi to Noida.
Click on the "save changes" tab and your document will be updated.
CouchDB Update Document Using cURL utility
cURL facilitates users to update the document in CouchDB by sending an HTTP request to the server using PUT method through cURL utility.
We have a document with id 001 in the database named my_database.
First of all, retrieve the revision id of the document that is to be updated. You can find the _rev of the document in the document by using the following command:
Use revision id _rev from the document to change the data. Here we change the age from 23 to 27.
You can verify the document if it is updated or not by using again the GET request.
Here you can see that age is now updated.
Points to remember while updating a document: