You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Martin Hewitt <ma...@gmail.com> on 2011/02/24 11:39:27 UTC

View for multiple IDs

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

Re: View for multiple IDs

Posted by Anup Bishnoi <pi...@gmail.com>.
Though I wonder what purpose it solves to make a view specifically for three
documents only, but if so, you could check for doc._id in the view function
to be one of those names and emit(doc._id, doc) in that case, doing nothing
otherwise

On Fri, Feb 25, 2011 at 10:34 PM, Simon Metson
<si...@googlemail.com>wrote:

> you can query the view with a post containing a json document like:
>
> {"keys": ["key1", "key2", ...]} See
> http://wiki.apache.org/couchdb/HTTP_view_API#Querying_Options
>
> Sent with Sparrow
> On Thursday, 24 February 2011 at 10:39, 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
> >
>

Re: View for multiple IDs

Posted by Simon Metson <si...@googlemail.com>.
you can query the view with a post containing a json document like:

{"keys": ["key1", "key2", ...]} See http://wiki.apache.org/couchdb/HTTP_view_API#Querying_Options

Sent with Sparrow
On Thursday, 24 February 2011 at 10:39, 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
>