Hi,

If you have a lot of values, be careful, you might overflow your int. There
is a technique[0] which does that in JS, returning not the sum and the count
fields but the average and the count fields.

[0]: http://tobyho.com/Taking_an_Average_in_CouchDB

On Thu, Oct 14, 2010 at 12:52 PM, Randall Leeds <[email protected]>wrote:

> http://wiki.apache.org/couchdb/Built-In_Reduce_Functions#A_stats
>
> Using the string "_stats" as your reduce function will get you a
> built-in reduction that contains both "count" and "sum" fields in the
> output.
>
> On Thu, Oct 14, 2010 at 00:29, sleepy <[email protected]> wrote:
> > Hi,
> >
> > I'm doing some statistics on my data and wondering is there
> > an straightforward way of calculating the mean value through reduce
> > function.
> > Maybe a build-in reduce function or something...
> >
> > sleepnova
> >
>

Reply via email to