incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Vander Wilt <nate-li...@calftrail.com>
Subject Re: Querying a view with a complex key with a wildcard
Date Wed, 30 Mar 2011 12:38:53 GMT
On Mar 29, 2011, at 8:39 PM, Mclendon, William C III wrote:
> Hi,
> 
> I've got a view that is built from a map.js that looks like this:
> 
> function(doc)
> {
>  if(doc['record type']=='search')
>    {
>    emit( [doc.status, doc.time], doc )
>    }
> }

Not related to the main discussion, but:
You may want to avoid emitting the whole doc as the value for the key, and just simply emit([doc.status,
doc.time]) — especially if you are using include_docs=true on your query anyway, emitting
the document as the value for a key will just bloat your view (and when you query you'll get
two copies sent over the wire too).

-nvw
Mime
View raw message