You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by "Nick Vatamaniuc (JIRA)" <ji...@apache.org> on 2015/09/28 16:33:04 UTC

[jira] [Reopened] (COUCHDB-2824) group & group_level view parameters override each

     [ https://issues.apache.org/jira/browse/COUCHDB-2824?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nick Vatamaniuc reopened COUCHDB-2824:
--------------------------------------

Re-opening to fix failing couch_mrview_http test

> group & group_level view parameters override each
> -------------------------------------------------
>
>                 Key: COUCHDB-2824
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-2824
>             Project: CouchDB
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: Database Core, HTTP Interface
>            Reporter: Nick Vatamaniuc
>            Assignee: Nick Vatamaniuc
>             Fix For: 2.0.0
>
>
> In a view query, if both group and group_level is specified the last one specified overrides any of the previous "group" or "group_level" parameters.
> Example:
> Create a db (db1), at least one document, a design doc (des1) that looks like:
> {code:javascript}
> {
>    "views": { 
>          "v1" : { "map": "function(d){
>                                      emit([1,1],1); 
>                                      emit([1,1],10);
>                                      emit([1,2],100); 
>                                      emit([1,2],1000); 
>                                      emit([2,2],10000);
>                                    }" , 
>                      "reduce":"_sum" 
>      } 
> }
> {code}
> Then these queries show the problem:
> {code}
> $ http "$DB1/db1/_design/des1/_view/v1?group_level=1&group=true"
> {"rows":[
> {"key":[1,1],"value":11},
> {"key":[1,2],"value":1100},
> {"key":[2,2],"value":10000}
> ]}
> {code}
> But users might expect group_level=1 results to show or a 400 request invalid.
> Specifying group_level=1 after group=true make group_level=1 take effect:
> {code}
> $ http "$DB1/db1/_design/des1/_view/v1?group_level=1&group=true&group_level=1"
> {"rows":[
> {"key":[1],"value":1111},
> {"key":[2],"value":10000}
> ]}
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)