couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sho Fukamachi <sho.fukama...@gmail.com>
Subject Re: dual purpose filter/count views
Date Sun, 09 Nov 2008 22:16:40 GMT

On 10/11/2008, at 9:01 AM, Chris Anderson wrote:

> Reduce:
>
> function(keys, values, rereduce) {
>  if (rereduce) {
>    return sum(values);
>  } else {
>    return values.length;
>  }
> }

Cool idea, works nicely in this situation and very elegant. Thanks for  
the tip!

Sho

> -- 
> Chris Anderson
> http://jchris.mfdz.com


Mime
View raw message