You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2021/11/08 14:26:49 UTC

[GitHub] [couchdb] jiahuili430 commented on a change in pull request #3819: _bulk_docs and new_edits: false should only be used by the replicator

jiahuili430 commented on a change in pull request #3819:
URL: https://github.com/apache/couchdb/pull/3819#discussion_r744774258



##########
File path: src/chttpd/src/chttpd_db.erl
##########
@@ -569,15 +569,23 @@ db_req(#httpd{method='POST',path_parts=[_,<<"_bulk_docs">>], user_ctx=Ctx}=Req,
             send_json(Req, 417, ErrorsJson)
         end;
     false ->
-        case fabric:update_docs(Db, Docs, [replicated_changes|Options]) of
-        {ok, Errors} ->
-            chttpd_stats:incr_writes(length(Docs)),
-            ErrorsJson = lists:map(fun update_doc_result_to_json/1, Errors),
-            send_json(Req, 201, ErrorsJson);
-        {accepted, Errors} ->
-            chttpd_stats:incr_writes(length(Docs)),
-            ErrorsJson = lists:map(fun update_doc_result_to_json/1, Errors),
-            send_json(Req, 202, ErrorsJson)
+        case lists:any(fun(JsonObj) ->
+            Doc = couch_db:doc_from_json_obj_validate(Db, JsonObj),

Review comment:
       Good idea!
   Add a function `validate_revs(Doc, NewEdits)` after `couch_db:doc_from_json_obj_validate(Db, JsonObj)`.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org