diff options
author | Jan Lehnardt <jan@apache.org> | 2018-07-08 15:48:39 +0200 |
---|---|---|
committer | Jan Lehnardt <jan@apache.org> | 2018-07-08 15:50:04 +0200 |
commit | 8d57bb350e46a1ab1450c90fb2f5525063018493 (patch) | |
tree | de0ab2f912d9908658d23541125e432771e6fff8 | |
parent | 120903698e0689f0f021411fb4bdbb164a7ae77a (diff) | |
download | couchdb-8d57bb350e46a1ab1450c90fb2f5525063018493.tar.gz |
Add `conflicts: true` option to mango selectors
This allows for using Mango queries for finding docs with conflicts.
Closes #1101
-rw-r--r-- | src/mango/src/mango_cursor_view.erl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mango/src/mango_cursor_view.erl b/src/mango/src/mango_cursor_view.erl index 1e2108b7d..dbea36e77 100644 --- a/src/mango/src/mango_cursor_view.erl +++ b/src/mango/src/mango_cursor_view.erl @@ -70,7 +70,8 @@ explain(Cursor) -> {end_key, maybe_replace_max_json(Args#mrargs.end_key)}, {direction, Args#mrargs.direction}, {stable, Args#mrargs.stable}, - {update, Args#mrargs.update} + {update, Args#mrargs.update}, + {conflicts, Args#mrargs.conflicts} ]}}]. @@ -283,9 +284,8 @@ apply_opts([{r, RStr} | Rest], Args) -> NewArgs = Args#mrargs{include_docs = IncludeDocs}, apply_opts(Rest, NewArgs); apply_opts([{conflicts, true} | Rest], Args) -> - % I need to patch things so that views can specify - % parameters when loading the docs from disk - apply_opts(Rest, Args); + NewArgs = Args#mrargs{conflicts = true}, + apply_opts(Rest, NewArgs); apply_opts([{conflicts, false} | Rest], Args) -> % Ignored cause default apply_opts(Rest, Args); |