anchor.diff:      NewDoc = Doc#doc{
           atts = UpdatedAtts ++ OldAtts2
       },
  -    {ok, NewRev} = fabric:update_doc(Db, NewDoc, []),
  +    {ok, NewRev} = fabric:update_doc(Db, NewDoc, [{user_ctx,Ctx}]),
   
       send_json(Req, 201, [{"Etag", "\"" ++ ?b2l(couch_doc:rev_to_str(NewRev)) ++ "\""}], {[
           {ok, true},
  
positive.code: update_doc(Req, Db, DocId, Json) ->
      update_doc(Req, Db, DocId, Json, []).
  
  update_doc(Req, Db, DocId, Json, Headers) ->
      #doc{deleted=Deleted} = Doc = couch_doc_from_req(Req, DocId, Json),
  
      case chttpd:header_value(Req, "X-Couch-Full-Commit") of
      "true" ->
          Options = [full_commit];
      "false" ->
          Options = [delay_commit];
      _ ->
          Options = []
      end,
      {Status, NewRev} = case fabric:update_doc(Db, Doc, Options) of
      {ok, NewRev1} -> {201, NewRev1};
  
negative.code:     Doc = couch_doc_open(Db, SourceDocId, SourceRev, []),
      % save new doc
      {ok, NewTargetRev} = fabric:update_doc(Db,
          Doc#doc{id=TargetDocId, revs=TargetRevs}, [{user_ctx,Ctx}]),
      % respond
      send_json(Req, 201,
          [{"Etag", "\"" ++ ?b2l(couch_doc:rev_to_str(NewTargetRev)) ++ "\""}],
  