Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
1.0
-
None
-
Cloudant BigCouch EC2 node
-
Committers Level (Medium to Hard)
Description
Repeating an "_id" in a _bulk_docs post data file results in both entries being reported as document conflict errors. The first occurrence actual inserts into the database, and only the second occurrence should report a conflict.
curl -d '{ "docs": [
{"_id":"foo"},
{"_id","foo"}] }' -H 'Content-Type:application/json' -X POST http://appadvice.cloudant.com/foo/_bulk_docs
[
{"id":"foo","error":"conflict","reason":"Document update conflict."},
{"id":"foo","error":"conflict","reason":"Document update conflict."}]
But the database shows that one new document was actually inserted.
Only the second occurrence should report conflict. The first occurrence should report the "_rev" property of the newly inserted doc.