couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mano <manoka...@gmail.com>
Subject Re: parametrized view generation
Date Wed, 10 Feb 2010 05:56:45 GMT
On Wed, Feb 10, 2010 at 11:14 AM, madhav sharma <mail.madhavsharma@gmail.com
> wrote:

> hi everyone
> I am couchdb for one of my project and i am stuck at a place where i need
> your help.
> My use case of problem is that i have a set of documents which have same
> field with different value and i need to get the value of  field (say name)
> from a document with id (say information) , and i want this mapfunction to
> be generic so that i can call this with different document id and get the
> the field value out of it.
> In sql it can just be(  select name from Table where id = 1233 )  so any
> help is appreciated
>

The map function can:

emit( [doc.name, doc._id], doc).

You can query this view with a 'key' of [name, 1233].

regds,
mano

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