Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Look for 'deleted' and <<"deleted">> for compatibility
BugzID: 13780
  • Loading branch information
kocolosk committed Jun 4, 2012
1 parent 0ad9c87 commit 33e5084f228703e109dd114bfe0fb5eb10b22df8
Showing 1 changed file with 10 additions and 1 deletion.
@@ -138,7 +138,7 @@ changes_callback({stop, EndSeq}, _) ->
changes_callback({change, {Change}, _}, _) ->
Node = couch_util:get_value(<<"id">>, Change),
case Node of <<"_design/", _/binary>> -> ok; _ ->
case couch_util:get_value(<<"deleted">>, Change, false) of
case is_deleted(Change) of
false ->
{Props} = couch_util:get_value(doc, Change),
gen_server:call(?MODULE, {add_node, mem3_util:to_atom(Node), Props});
@@ -149,3 +149,12 @@ changes_callback({change, {Change}, _}, _) ->
{ok, couch_util:get_value(<<"seq">>, Change)};
changes_callback(timeout, _) ->
{ok, nil}.

is_deleted(Change) ->
case couch_util:get_value(<<"deleted">>, Change) of
undefined ->
% keep backwards compatibility for a while
couch_util:get_value(deleted, Change, false);
Else ->
Else
end.

0 comments on commit 33e5084

Please sign in to comment.