lanto03 / couchdb-python

Automatically exported from code.google.com/p/couchdb-python
Other
0 stars 0 forks source link

Ordering of options on the querystring #164

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Query a view using group=True and group_level=[int]
2. group_level is ignore since python-couchdb reorders the options
3. couchdb requires group=true becomes before group_level=X in teh querystring

What is the expected output? What do you see instead?
Options order by the order they are passed to db.view

What version of the product are you using? On what operating system?
0.8

Please provide any additional information below.
Against couchdb 1.0.1 

Original issue reported on code.google.com by mattdrin...@gmail.com on 9 Feb 2011 at 8:12

GoogleCodeExporter commented 8 years ago
http://mail.python.org/pipermail/chicago/2009-February/005596.html

I dont think we should use **options. 

Original comment by mattdrin...@gmail.com on 9 Feb 2011 at 9:02

GoogleCodeExporter commented 8 years ago
Can you provide some references to docs/wiki where query arguments order is 
described?

Original comment by daevaorn on 9 Feb 2011 at 10:38

GoogleCodeExporter commented 8 years ago
group and group_level are mutually exclusive options, so it makes no sense to 
use them together. group=false is an alias for group_level=0; group=true is 
equivalent to group_level=<max> where max is the maximum number of items in a 
key.

Original comment by matt.goo...@gmail.com on 9 Feb 2011 at 10:56

GoogleCodeExporter commented 8 years ago
And just for reference, here's the relevant Erlang code:

parse_view_param("group", Value) ->
    case parse_bool_param(Value) of
        true -> [{group_level, exact}];
        false -> [{group_level, 0}]
    end;
parse_view_param("group_level", Value) ->
    [{group_level, parse_positive_int_param(Value)}];

Original comment by matt.goo...@gmail.com on 9 Feb 2011 at 10:58

GoogleCodeExporter commented 8 years ago
My bad. Yes you are correct about them being mutually exclusive. Problem 
resolved 

Original comment by mattdrin...@gmail.com on 10 Feb 2011 at 9:30