summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Lehnardt <jan@apache.org>2018-07-08 15:48:39 +0200
committerJan Lehnardt <jan@apache.org>2018-07-08 15:50:04 +0200
commit8d57bb350e46a1ab1450c90fb2f5525063018493 (patch)
treede0ab2f912d9908658d23541125e432771e6fff8
parent120903698e0689f0f021411fb4bdbb164a7ae77a (diff)
downloadcouchdb-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.erl8
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);