[ 
https://issues.apache.org/jira/browse/COUCHDB-2910?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15038804#comment-15038804
 ] 

Kerem Güneş commented on COUCHDB-2910:
--------------------------------------

I understand CouchDB is not for transactions, but I just wanted to provide that 
option for users.

So, I tried "all_or_nothing":true but no error code returning from server again 
and coming 201. I think I could not understand it. =)

Anyway, if there is no way to figure out this, I m going to do something 
another or leave it as is to handling bulk errors.

Thank you Alex!

And I would say to this, as always I say that: you do a great thing building 
CouchDB.

// this document is already deleted with same rev
POST /foo/_bulk_docs? HTTP/1.0
Host: localhost:5984
Connection: close
Accept: application/json
Content-Type: application/json
User-Agent: Couch/v1.0.0 (+http://github.com/qeremy/couch-go)
Content-Length: 135

{"all_or_nothing":true,"docs":[{"_deleted":true,"_id":"7ee9cdd673b109e030cec8c6f100322b","_rev":"1-3c92d3e67136c8b206d90ea37a3ee76d"}]}

HTTP/1.0 201 Created
Server: CouchDB/1.5.0 (Erlang OTP/R16B03)
Date: Thu, 03 Dec 2015 23:08:12 GMT
Content-Type: application/json
Content-Length: 97
Cache-Control: must-revalidate

[{"ok":true,"id":"7ee9cdd673b109e030cec8c6f100322b","rev":"2-763af09f36fb1c014dd68031a087f069"}]

> Wrong HTTP Status Code on Error
> -------------------------------
>
>                 Key: COUCHDB-2910
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-2910
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>            Reporter: Kerem Güneş
>
> Hi,
> If I send  a _rev that will cos conflict, server is sending 201 code.
> POST /foo/_bulk_docs? HTTP/1.0
> Host: localhost:5984
> Connection: close
> Accept: application/json
> Content-Type: application/json
> User-Agent: Couch/v1.0.0 (+http://github.com/qeremy/couch-go)
> Content-Length: 126
> {"docs":[{"_id":"7ee9cdd673b109e030cec8c6f10020f7","_rev":"1-WRONG-REV","name":"kerem
>  3","type":"tmp"}]}
> HTTP/1.0 201 Created
> Server: CouchDB/1.5.0 (Erlang OTP/R16B03)
> Date: Thu, 03 Dec 2015 20:11:02 GMT
> Content-Type: application/json
> Content-Length: 100
> Cache-Control: must-revalidate
> [{"id":"7ee9cdd673b109e030cec8c6f10020f7","error":"conflict","reason":"Document
>  update conflict."}]
> Thank you!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to