anchor.diff:    case bson:lookup(<<"_id">>, Doc) of
       {} -> bson:update(<<"_id">>, mongo_id_server:object_id(), Doc);
       _Value -> Doc
  -  end.
  +  end.
positive.code:   }).
  
  %% @doc Count selected documents
  -spec count(pid(), colldb(), selector()) -> integer().
  count(Connection, Coll, Selector) ->
    count(Connection, Coll, Selector, 0).
  
  %% @doc Count selected documents up to given max number; 0 means no max.
  %%     Ie. stops counting when max is reached to save processing time.
  -spec count(pid(), colldb(), selector(), integer()) -> integer().
  count(Connection, Coll, Selector, Limit) when not is_binary(Coll) ->
    count(Connection, mc_utils:value_to_binary(Coll), Selector, Limit);
  count(Connection, Coll, Selector, Limit) when Limit =< 0 ->
    {true, #{<<"n">> := N}} = command(Connection, {<<"count">>, Coll, <<"query">>, Selector}),
    trunc(N);
  count(Connection, Coll, Selector, Limit) ->
    {true, #{<<"n">> := N}} = command(Connection, {<<"count">>, Coll, <<"query">>, Selector, <<"limit">>, Limit}),
    trunc(N). % Server returns count as float
  
  %% @doc Create index on collection according to given spec.
  %%      The key specification is a bson documents with the following fields:
  
negative.code: 
  
  %% @private
  do_count(Connection, Query) ->
    {true, #{<<"n">> := N}} = command(Connection, Query),
    trunc(N). % Server returns count as float
  
  %% @private
  %% Convert maps or proplists to bson
  prepare_doc(Docs, AssignFun) when is_list(Docs) ->  %list of documents
    case mc_utils:is_proplist(Docs) of
  