incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fabio Batalha Cunha dos Santos <fabio.bata...@scielo.org>
Subject Re: View for multiple IDs
Date Thu, 24 Feb 2011 14:42:20 GMT
I'm not sure, but in this situation the document ID must contain the keys he
want to fetch. With the view it's possible to define other keys different
from the document id.


*Fabio Batalha C. Santos*
Colegiado SciELO
www.scielo.org
FAPESP - CNPq - BIREME - FapUNIFESP



On Thu, Feb 24, 2011 at 11:31 AM, David Hardtke <david@cloudant.com> wrote:

>
> You don't need a view for this.  You can use the bulk document API to fetch
> multiple documents with a single request:
>
> http://wiki.apache.org/couchdb/HTTP_Bulk_Document_API
>
>
> On 02/24/11 05:26, Justin Walgran wrote:
>
>> You definitely want to POST the keys to the view. Looping over the
>> entire view in a list function slows down noticeably for a large
>> number of documents.
>>
>> To get the docs with the 3 keys mentioned in your example, you could
>> do something like this.
>>
>> curl -X POST -d '{"keys": ["asdf", "powsf", "aaaa"]}' -H
>> 'Content-Type: application/json'
>> 'http://localhost:5984/db/_design/app/_view/view_name'
>>
>>
>> Justin
>>
>> On Thu, Feb 24, 2011 at 6:41 AM, Martin Hewitt<martin@thenoi.se>  wrote:
>>
>>> Hi all,
>>>
>>> How would I create a view  to retrieve documents with the IDs (i.e.
>>> non-numeric, non-sequential):
>>>
>>> ["asdf", "powsf", "aaaa"]
>>>
>>> I would like the three documents that match these IDs, is this doable
>>> in one view or should I just retrieve them individually?
>>>
>>> Thanks,
>>>
>>> Martin
>>>
>>>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message