Skip to content

Commit d33edf7

Browse files
rnewsonnickva
authored andcommitted
include rev when scanning
1 parent 8f01581 commit d33edf7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/couch_scanner/src/couch_scanner_plugin.erl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -680,8 +680,10 @@ fold_ddocs(Fun, #st{dbname = DbName, mod = Mod} = Acc) ->
680680
% We just got these docs from the cluster, they are already saved on disk.
681681
ejson_to_doc({[_ | _] = Props}) ->
682682
{value, {_, DocId}, Props1} = lists:keytake(<<"_id">>, 1, Props),
683-
Props2 = [{K, V} || {K, V} <- Props1, K =:= <<>> orelse binary:first(K) =/= $_],
684-
#doc{id = DocId, body = {Props2}}.
683+
{value, {_, Rev}, Props2} = lists:keytake(<<"_rev">>, 1, Props1),
684+
{Pos, RevId} = couch_doc:parse_rev(Rev),
685+
Props3 = [{K, V} || {K, V} <- Props2, K =:= <<>> orelse binary:first(K) =/= $_],
686+
#doc{id = DocId, revs = {Pos, [RevId]}, body = {Props3}}.
685687

686688
% Skip patterns
687689

0 commit comments

Comments
 (0)