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-13 17:04:55 +0200
commit45a0ad9e78bbd5596b58f369ddda44254555755b (patch)
treeef2dec137f9f6bfefd94e68eddb9fee16bf3a57d
parent71cf9f4b53728bd5df5f5b5cc349187ca9da67bb (diff)
downloadcouchdb-45a0ad9e78bbd5596b58f369ddda44254555755b.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);