anchor.diff:              case db_run(BucketOverride, couchbeam, open_doc, [to_driver_key(Bucket, Key), [{<<"open_revs">>, all}]], 3) of
                   {ok,{multipart,M}} ->
                       case collect_mp(couchbeam:stream_doc(M), []) of
  -                        [{doc,{Proplist}}] ->
  -                            case verify_ans(Proplist) of
  -                                true ->
  -                                    {_, Rev} = lists:keyfind(<<"_rev">>, 1, Proplist),
  -                                    Proplist1 = [KV || {<<"_", _/binary>>, _} = KV <- Proplist],
  -                                    Proplist2 = Proplist -- Proplist1,
  -                                    {_WasUpdated, Version, Value} = datastore_json:decode_record_vcs({Proplist2}),
  -                                    Deleted = case lists:keyfind(<<"deleted">>, 1, Proplist) of
  -                                        {_, true} -> true;
  -                                        _ -> false
  -                                    end,
  -                                    RetDoc = #document{key = Key, value = Value, rev = Rev, version = Version, deleted = Deleted},
  -                                    {ok, RetDoc};
  -                                _ ->
  -                                    {error, db_internal_error}
  -                            end;
  +                        List when is_list(List) ->
  +                            lists:foldl(fun({doc,{Proplist}}, Ans) ->
  +                                DocAnc = case verify_ans(Proplist) of
  +                                    true ->
  +                                        {_, Rev} = lists:keyfind(<<"_rev">>, 1, Proplist),
  +                                        Proplist1 = [KV || {<<"_", _/binary>>, _} = KV <- Proplist],
  +                                        Proplist2 = Proplist -- Proplist1,
  +                                        {_WasUpdated, Version, Value} = datastore_json:decode_record_vcs({Proplist2}),
  +                                        Deleted = case lists:keyfind(<<"deleted">>, 1, Proplist) of
  +                                            {_, true} -> true;
  +                                            _ -> false
  +                                        end,
  +                                        RetDoc = #document{key = Key, value = Value, rev = Rev, version = Version, deleted = Deleted},
  +                                        {ok, RetDoc};
  +                                    _ ->
  +                                        {error, db_internal_error}
  +                                end,
  +                                case {Ans, DocAnc} of
  +                                    {{error, empty_answer}, _} ->
  +                                        DocAnc;
  +                                    {{error, db_internal_error}, _} ->
  +                                        {error, db_internal_error};
  +                                    {_, {error, db_internal_error}} ->
  +                                        {error, db_internal_error};
  +                                    {{ok, #document{rev = R1} = D1}, {ok, #document{rev = R2} = D2}} ->
  +                                        {R1Num, R1Id} = rev_to_info(R1),
  +                                        {R2Num, R2Id} = rev_to_info(R2),
  +                                        case R1Num of
  +                                            R2Num ->
  +                                                case R1Id > R2Id of
  +                                                    true ->
  +                                                        {ok, D1};
  +                                                    false ->
  +                                                        {ok, D2}
  +                                                end;
  +                                            Higher when Higher > R2Num ->
  +                                                {ok, D1};
  +                                            _ ->
  +                                                {ok, D2}
  +                                        end
  +                                end
  +                            end, {error, empty_answer}, List);
                           MultipartError ->
                               ?error("Multipart get error: ~p", [MultipartError]),
                               {error, db_internal_error}
  
positive.code:                                         {ok, _} ->
                                              % TODO - what happens if first save is ok and second fails
                                              % Delete in new task type that starts if first try fails
                                              delete_doc(ModelConfig, Old),
                                              {ok, Key};
                                          Other ->
                                              Other
  
negative.code:                end,
      critical_section:run(SynchKey,
          fun() ->
              case get(ModelConfig, Key) of
              % TODO -VFS 2971
  %%            case get_last(ModelConfig, Key) of
                  {error, {not_found, _}} ->
                      save_revision(ModelConfig, BucketOverride, ToSave#document{rev = {RNum, [Id]}});
                  {error, not_found} ->
                      save_revision(ModelConfig, BucketOverride, ToSave#document{rev = {RNum, [Id]}});
                  {error, Reason} ->
                      {error, Reason};
                  {ok, #document{key = Key, rev = Rev, deleted = OldDel} = Old} ->
                      {OldRNum, OldId} = rev_to_info(Rev),
                      case RNum of
                          OldRNum ->
  