incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Carey" <paul.p.ca...@gmail.com>
Subject Re: on emit...
Date Tue, 13 Jan 2009 13:53:47 GMT
> If the view being generated is comprised of only  a map operation and
> not a map/reduce operation, the (v)value part of this key/value
> combination has no meaning as it is not used in the generation of the
> view.?

The value has whatever meaning you assign to it - it may be the entire
document, just a subset of fields you're interested in for that view,
null or something else.

> The (v)value returned affects the physical size of the view.?

Yep, a view index will contain both the key and value.

> The (v)value returned is not/can not be used when querying a map only view.?

You can't specify the value in a query, but the result of the query
will contain the value.

> Most examples I've seen show emit returning a simple scalar for the
> emit'd (k)key, however I've also seen a list being returned.   When
> would a list be preferable to a simple scalar?

If you want to query across a few fields, so given the following emit
you could issue a date limited query for posts by a particular author.
emit([doc.author_name, doc.posted_date], doc);

Hope this helps

Paul

Mime
View raw message