You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2018/07/08 13:50:04 UTC

[couchdb] branch fix/1101/mango-conflicts created (now 20e2b21)

This is an automated email from the ASF dual-hosted git repository.

jan pushed a change to branch fix/1101/mango-conflicts
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


      at 20e2b21  Add `conflicts: true` option to mango selectors

This branch includes the following new commits:

     new 20e2b21  Add `conflicts: true` option to mango selectors

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[couchdb] 01/01: Add `conflicts: true` option to mango selectors

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jan pushed a commit to branch fix/1101/mango-conflicts
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 20e2b21d4f743d1af25da672d51d49d115de0b91
Author: Jan Lehnardt <ja...@apache.org>
AuthorDate: Sun Jul 8 15:48:39 2018 +0200

    Add `conflicts: true` option to mango selectors
    
    This allows for using Mango queries for finding docs with conflicts.
---
 src/mango/src/mango_cursor_view.erl | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/mango/src/mango_cursor_view.erl b/src/mango/src/mango_cursor_view.erl
index 1e2108b..dbea36e 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);