incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sho Fukamachi <>
Subject Re: more newbie questions - how to use more than one key in views
Date Thu, 17 Jul 2008 16:27:15 GMT
That sound you heard was my head hitting the desk.

I'd read that article but somehow just couldn't connect that final  
dot. Of course it then worked first time when I just put the emitters  
and keys in an array  (>_<)

Carry on folks, nothing to see here...

On 18/07/2008, at 1:51 AM, Dean Landolt wrote:

>> Problem is I need an additional filter in there and I'm not sure  
>> how to get
>> it in - and it's far from ideal to hardcode the language. Can I  
>> have more
>> than one key in the emit function? Any examples of this kind of thing
>> anywhere?
> That should get you started.
>> I mean, what I really want to do is
>> "function(doc) { if (doc.type == 'content_node' )  
>> emit((doc.title_slug,
>> doc.language, doc.user_id), doc); }"
>> but somehow I don't think it works like that.
> I know, that'd be amazing if it did though, right? Turns out it  
> does, and
> it's a huge help in search and sort operations (though it's still  
> taking me
> some time to adjust to all the possibilities). From your example, just
> change the inside set of () in the emit to [] and you're in business.

View raw message