anchor.diff:      case couch_db:get_doc_info(Db, DocId) of
           {ok, DocInfo} ->
               %% get change row
  -            ChangeRow = view_change_row(Db, DocInfo, Args),
  -            %% emit change row
  -            Callback({change, ChangeRow, Prepend}, ResponseType),
  -
  -            %% if we achieved the limit, stop here, else continue.
  -            NewLimit = OldLimit + 1,
  -            if Limit > NewLimit ->
  -                    {ok, {<<",\n">>, Db, NewLimit, Callback, Args}};
  -                true ->
  -                    {stop, {<<"">>, Db, NewLimit, Callback, Args}}
  +            {Deleted, ChangeRow} = view_change_row(Db, DocInfo, Args),
  +
  +            case Removed of
  +                true when Deleted /= true ->
  +                    %% the key has been removed from the view but the
  +                    %% document hasn't been deleted so ignore it.
  +                    {ok, Acc};
  +                _ ->
  +                    %% emit change row
  +                    Callback({change, ChangeRow, Prepend}, ResponseType),
  +
  +                    %% if we achieved the limit, stop here, else continue.
  +                    NewLimit = OldLimit + 1,
  +                    if Limit > NewLimit ->
  +                            {ok, {<<",\n">>, NewLimit, Db, Callback, Args}};
  +                        true ->
  +                            {stop, {<<"">>, NewLimit, Db, Callback, Args}}
  +                    end
               end;
           {error, not_found} ->
               %% doc not found, continue
  
positive.code: view_changes_cb(heartbeat, {_, _, _, Callback, Args}=Acc) ->
      Callback(timeout, Args#changes_args.feed),
      {ok, Acc};
  view_changes_cb({{Seq, _Key, DocId}, _VAl},
                  {Prepend, OldLimit, Db0, Callback, Args}=Acc) ->
  
      #changes_args{
          feed = ResponseType,
  
negative.code:                 end;
              false ->
                  []
      end}}.
  
  parse_changes_query(Req, Db) ->
      ChangesArgs = lists:foldl(fun({Key, Value}, Args) ->
  