incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephan Bardubitzki <step...@bardubitzki.com>
Subject Re: How to sort?
Date Fri, 07 Sep 2012 21:39:53 GMT
I know, but how should the request key look like?

{ [key: category, {}] } ???

On 12-09-07 02:31 PM, Jayson Barley wrote:
> Add it as part of the key. I would recommend
>
> emit([category, doc.name], doc)
> On Sep 7, 2012 2:22 PM, "Stephan Bardubitzki" <stephan@bardubitzki.com>
> wrote:
>
>> Still learning CouchDB, I have the following view function:
>>
>> ||"|getAllByCategory|":|{
>>      "|map|":|"function(doc) { if(doc.categories) { doc.categories.forEach(
>> **function(category) { emit(category, doc) });}}"|
>> }|||
>>
>> That gives me all docs for a certain category. I would like to have the
>> emitted docs sorted by doc.name, how can I achieve that?
>>
>> Thanks,
>> Stephan
>>
> --------------------------------
> Spam/Virus scanning by CanIt Pro
>
> For more information see
> http://www.kgbinternet.com/SpamFilter.htm
>
> To control your spam filter, log in at
> http://filter.kgbinternet.com
>


Mime
View raw message