anchor.diff:              {[{Key, {dups, [Val1, Val2]}} | Rest], IdKeys, Log2};
           ({Key, Value}, {Rest, IdKeys, Log2}) ->
               {[{Key, Value} | Rest], [{Id, Key} | IdKeys],
  -             dict:append(DocId, {Id, {Key, Seq, add}}, Log2)}
  +             dict:append({DocId, Rev}, {Id, {Key, Seq, add}}, Log2)}
       end,
       InitAcc = {[], VIdKeys, Log},
       couch_stats:increment_counter([couchdb, mrview, emits], length(KVs)),
  
positive.code:                     LogValue = {ViewId, {Key, UpdatedSeq, del}},
                      Log5 = dict:append(DocId, LogValue, Log4),
                      DelAcc5 = dict:append(ViewId, {Key, Seq, DocId}, DelAcc4),
                      AddValue = {{UpdatedSeq, Key}, {DocId, ?REM_VAL}},
                      AddAcc5 = dict:append(ViewId, AddValue, AddAcc4),
                      {Log5, AddAcc5, DelAcc5};
                  false ->
  
negative.code: 
  
  merge_results({DocId, _Seq, Rev, []}, ViewKVs, DocIdKeys, Log) ->
      {ViewKVs, [{DocId, []} | DocIdKeys], dict:store({DocId, Rev}, [], Log)};
  merge_results({DocId, Seq, Rev, RawResults}, ViewKVs, DocIdKeys, Log) ->
      JsonResults = couch_query_servers:raw_to_ejson(RawResults),
      Results = [[list_to_tuple(Res) || Res <- FunRs] || FunRs <- JsonResults],
      case Results of
          [[],[]] ->
              {ViewKVs, [{DocId, []} | DocIdKeys], dict:store({DocId, Rev}, [], Log)};
          _ ->
              {ViewKVs1, ViewIdKeys, Log1} = insert_results(DocId, Seq, Rev, Results, ViewKVs, [], [], Log),
              {ViewKVs1, [ViewIdKeys | DocIdKeys], Log1}
      end.
  
  
  insert_results(DocId, _Seq, _Rev, [], [], ViewKVs, ViewIdKeys, Log) ->
  