couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robertkowal...@apache.org
Subject [1/2] chttpd commit: updated refs/heads/COUCHDB-2462-bulk-ok-true to 687cd8c
Date Sun, 30 Nov 2014 02:01:54 GMT
Repository: couchdb-chttpd
Updated Branches:
  refs/heads/COUCHDB-2462-bulk-ok-true [created] 687cd8c7a


Return ok:true on _bulk_doc update

Return `ok: true` on a successful _bulk_doc update like in
CouchDB 1.6.

Example success message on 2.0:
```
[{"id":"Brocket","rev":"6-b6fa9e703c3eb92aa9c3a49cedf1e8c2"}]
```

Example error message on 2.0:
```
[{"id":"Blaggie-System","error":"conflict",
  "reason":"Document update conflict."}]
```

Finally closes COUCHDB-2462


Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/fa9d7bca
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/fa9d7bca
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/fa9d7bca

Branch: refs/heads/COUCHDB-2462-bulk-ok-true
Commit: fa9d7bca79f1df2d592335b633ac69a3d5e43a51
Parents: b44515f
Author: Robert Kowalski <robertkowalski@apache.org>
Authored: Wed Nov 19 02:11:25 2014 +0100
Committer: Robert Kowalski <robertkowalski@apache.org>
Committed: Wed Nov 19 19:26:16 2014 +0100

----------------------------------------------------------------------
 src/chttpd_db.erl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/fa9d7bca/src/chttpd_db.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_db.erl b/src/chttpd_db.erl
index 24eb78c..7d5f209 100644
--- a/src/chttpd_db.erl
+++ b/src/chttpd_db.erl
@@ -835,9 +835,9 @@ update_doc_result_to_json({{Id, Rev}, Error}) ->
 update_doc_result_to_json(#doc{id=DocId}, Result) ->
     update_doc_result_to_json(DocId, Result);
 update_doc_result_to_json(DocId, {ok, NewRev}) ->
-    {[{id, DocId}, {rev, couch_doc:rev_to_str(NewRev)}]};
+    {[{ok, true}, {id, DocId}, {rev, couch_doc:rev_to_str(NewRev)}]};
 update_doc_result_to_json(DocId, {accepted, NewRev}) ->
-    {[{id, DocId}, {rev, couch_doc:rev_to_str(NewRev)}, {accepted, true}]};
+    {[{ok, true}, {id, DocId}, {rev, couch_doc:rev_to_str(NewRev)}, {accepted, true}]};
 update_doc_result_to_json(DocId, Error) ->
     {_Code, ErrorStr, Reason} = chttpd:error_info(Error),
     {[{id, DocId}, {error, ErrorStr}, {reason, Reason}]}.


Mime
View raw message