davisp commented on a change in pull request #1110: Make _design_docs to 
respect query parameters
URL: https://github.com/apache/couchdb/pull/1110#discussion_r164151518
 
 

 ##########
 File path: src/couch/src/couch_db.erl
 ##########
 @@ -1752,11 +1752,13 @@ set_namespace_range(Options, NS) ->
         true ->
             SK = select_gt(SK0, <<NS/binary, "/">>),
             EK = select_lt(EK0, <<NS/binary, "0">>),
-            [{start_key, SK}, {EKType, EK}];
+            [{dir, proplists:get_value(dir, Options, fwd)},
+                {start_key, SK}, {EKType, EK}];
         false ->
             SK = select_lt(SK0, <<NS/binary, "0">>),
             EK = select_gt(EK0, <<NS/binary, "/">>),
-            [{dir, rev}, {start_key, SK}, {EKType, EK}]
+            [{dir, proplists:get_value(dir, Options, rev)},
 
 Review comment:
   I should note that this is a long standing API oddity that we've gone back 
and forth on. I.e., do we try and help the user by swapping keys when we can 
detect that they'd have an empty result or not. Unless I'm forgetting a change 
we've always landed on the "don't to it" as depending on how you read the 
request it violates what they ask for.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to