couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jamie Talbot (JIRA)" <j...@apache.org>
Subject [jira] Commented: (COUCHDB-523) View API POST keys to retrieve multiple docs by key could also allow for multiple 'range' queries, i.e. an array of { startkey: .., endkey: ... } params in the POST
Date Thu, 25 Mar 2010 03:13:36 GMT

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

Jamie Talbot commented on COUCHDB-523:
--------------------------------------

I should mention that the supplied patch allows the setting of a group_level, but doesn't
aggregate across the differing ranges. I.e. Say I had a blog and my "post count" view had
a map to output "1" for every post and a reduce to sum those values, querying it with:

{
    "keys": [
        {
            "startkey": ["Category A","2010","03"],
            "endkey": ["Category A","2010","04",{}]
        },
        {
            "startkey": ["Category A","2010","06"],
            "endkey": ["Category A","2010","07",{}]
        }
    ]
}

using group=true&group_level=1

still gives me 2 rows:
Category A : 12
Category A : 14 

(for example).  Would be nice if it gave me one row of 26.

I think it's because the ranges are processed separately (more of a convenience than anything).
 Someone more knowledgeable than me can correct me if I'm wrong.


> View API POST keys to retrieve multiple docs by key could also allow for multiple 'range'
queries, i.e. an array of { startkey: .., endkey: ... } params in the POST
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-523
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-523
>             Project: CouchDB
>          Issue Type: Improvement
>          Components: HTTP Interface
>            Reporter: Nathan Stott
>            Priority: Minor
>         Attachments: couch_httpd_view.erl, multi_start_end_key.diff
>
>
> It would be useful if I could do a single POST to a view to retrieve multiple ranges
specified by startkey, endkey.
> The format could be as follows:
> { "ranges": [ { "startkey": "a", "endkey": "c" }, { "startkey":"g", "endkey":"z" } ]
}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message