Data Conflict 409 Error

couchdb

I am getting a Document Conflict 409 error when I try to add a document to CouchDB. The scenario is as follows.

  1. Add Doc1 Rev1 to Couch using HTTP PUT
  2. Delete Doc1 Rev1 from Couch using HTTP DELETE
  3. Add Doc1 Rev2 to Couch using HTTP PUT

Why would step 3 cause Couch to return a Data Conflict 409 error? How can a document be in conflict with a deleted document? Any insight would be greatly appreciated.

Jim

Best Answer

This is by design. To create a document, don't pass a _rev value in the body.

Related Topic