According to the CouchDB Wiki on PUT operations.
To update an existing document, you also issue a PUT request. In this case, the JSON body must contain a _rev property, which lets CouchDB know which revision the edits are based on. If the revision of the document currently stored in the database doesn't match, then a 409 conflict error is returned.
My goal is to perform a bulk_docs update:
curl -X POST [domain]/[couch db name]/_bulk_docs -H "Content-type: application/json" -d @[some document].json
My workflow is like this:
- My data is in an Google Docs spreadsheet.
- I convert the spreadsheet data to JSON by copying and pasting into Mr. Data Converter
- I use cURL (as show above) to add/update documents
The problem is that the first time I add new documents, everything works perfectly, however the next time I post the same documents, I get following error for each document:
...{"id":"28"," error":"conflict","reason":"Document update conflict."}...
Is there any way to update an existing document without including a _rev property?