Document conflict error when updating a design document in couchDB Document conflict error when updating a design document in couchDB curl curl

Document conflict error when updating a design document in couchDB


When you are updating a document, you have to provide the the revision of the document you are updating. It allows to only update the latest version of the document and will fail if someone updated the document since you last saw (fetched) it. In your case you should first execute a HEAD http request to the food database design doc you are trying to update. HEAD is fairly lightweight and will return basic info about a document, including its current revision (ETag field in the response). Then use that revision to update the doc with new content. More info about the API: https://docs.couchdb.org/en/stable/api/document/common.html