From user-return-15070-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Thu Feb 24 14:42:52 2011 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 61721 invoked from network); 24 Feb 2011 14:42:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Feb 2011 14:42:52 -0000 Received: (qmail 9203 invoked by uid 500); 24 Feb 2011 14:42:51 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 8870 invoked by uid 500); 24 Feb 2011 14:42:48 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 8862 invoked by uid 99); 24 Feb 2011 14:42:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Feb 2011 14:42:47 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.216.52] (HELO mail-qw0-f52.google.com) (209.85.216.52) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Feb 2011 14:42:43 +0000 Received: by qwf6 with SMTP id 6so537615qwf.11 for ; Thu, 24 Feb 2011 06:42:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.31.15 with SMTP id w15mr750564qcc.22.1298558540102; Thu, 24 Feb 2011 06:42:20 -0800 (PST) Received: by 10.229.229.1 with HTTP; Thu, 24 Feb 2011 06:42:20 -0800 (PST) In-Reply-To: <4D666BB5.2010405@cloudant.com> References: <87AEBE6D-D363-46D1-8213-0D69C8EC8E26@thenoi.se> <4D666BB5.2010405@cloudant.com> Date: Thu, 24 Feb 2011 11:42:20 -0300 Message-ID: Subject: Re: View for multiple IDs From: Fabio Batalha Cunha dos Santos To: user@couchdb.apache.org Cc: David Hardtke Content-Type: multipart/alternative; boundary=001636833f8c80be60049d083858 --001636833f8c80be60049d083858 Content-Type: text/plain; charset=ISO-8859-1 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 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 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 >>> >>> > --001636833f8c80be60049d083858--