[ 
https://issues.apache.org/jira/browse/COUCHDB-2824?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14933371#comment-14933371
 ] 

ASF GitHub Bot commented on COUCHDB-2824:
-----------------------------------------

GitHub user nickva opened a pull request:

    https://github.com/apache/couchdb-couch-mrview/pull/32

    [mrview] fix http test

     COUCHDB-2824
    
    Now all couch_mrview eunit tests should pass:
    
    ```
    $ export BUILDDIR=`pwd` && rebar -r eunit apps=couch_mrview
    ...
    =======================================================
      All 104 tests passed.
    ==> rel (eunit)
    ==> couchdb (eunit)
    ```


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/nickva/couchdb-couch-mrview 2824-fix-http-test

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/couchdb-couch-mrview/pull/32.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #32
    
----
commit a9d14eabe1423db0142658cbcf216fb7c6982e8b
Author: Nick Vatamaniuc <[email protected]>
Date:   2015-09-28T14:31:55Z

    [mrview] fix http test
    
     COUCHDB-2824

----


> 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)

Reply via email to