incubator-couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anand Chitipothu (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 Wed, 03 Nov 2010 16:54:27 GMT

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

Anand Chitipothu commented on COUCHDB-523:
------------------------------------------


How about considering a dict instead of a list for queries? Keeping track of dictionary keys
is much easier than keeping track of array indicies.

{
    "queries": {
        "foo": {"key":"foo"}, 
        "bar": {"startkey":"bar", "endkey":"baz", "limit":10}, 
        ...
    }
} 

And the response will be dictionary with same keys. 

{
    "results": {
        "foo": {"total_rows":100, "offset":34, "rows":[...]}, 
        "bar": {"total_rows":100, "offset":20, "rows":[...]} 
    }
}

I'm not very sure if introducing  another nested level "results" is required, but it looks
symmetrical to the request.


> 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
>            Assignee: Adam Kocoloski
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: couch_httpd_view.erl, multi_start_end_key.diff, ranged_key_post.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