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

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

I wanted this feature so much, I hacked up a version that appears to do it.  
I'm nowhere near an Erlang or Couch expert, but it seems to do what I want and 
still be lightning fast so perhaps it is a solution.  The only changes were 
made to couch_httpd_view.erl.  General theory of operation is to pattern match 
start and end key fields from the Key variable in output_map_view and 
output_reduce_view.  I also had to list the restrictions on group_levels for 
multi-key documents seeing as they do make sense in this context.

Was pretty much scrambling in the dark, but If that sounds like a sensible 
approach, and someone can give me pointers on how to contribute, I'd be happy 
to attach it here. 

In the meantime, I'll attach my hacked up version of couch_http_view.erl.  I've 
also included a diff from version 0.10.1. 

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

Reply via email to