It's not intended behavior, but I'd say just don't do that. Editing the same document twice in a bulk update is not supported. Maybe we should add an explicit check and return an error.

-Damien

On Dec 3, 2008, at 11:39 AM, Michael Hendricks wrote:

What should be the proper behavior for a bulk update request which
asks to delete a document and to update it at the same time?  For
example:

   POST http://127.0.0.1:5984/net-couchdb-11942-61931/_bulk_docs
   Accept: application/json
   Content-Length: 104

{"docs":[{"_deleted":true,"_id":"drei","_rev":"683265243"}, {"_id":"drei","third":3,"_rev":"683265243"}]}

Until recently (r713132), CouchDB returned a 412 response to indicate
that there was a conflict.  That seems like the right thing to do.
The new response seems broken:

   HTTP/1.1 201 Created
   Cache-Control: must-revalidate
   Date: Wed, 03 Dec 2008 16:24:15 GMT
   Server: CouchDB/0.9.0a-incubating (Erlang OTP/R12B)
   Content-Length: 89
   Content-Type: application/json
   Client-Date: Wed, 03 Dec 2008 16:24:15 GMT
   Client-Peer: 127.0.0.1:5984
   Client-Response-Num: 15

{"ok":true,"new_revs":[{"id":"drei","rev":"2472902046"}, {"id":"drei","rev":"965136091"}]}

In other words, it created two new revisions for the same document.
Is that intended behavior?

--
Michael

Reply via email to