couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Quentin Pradet <quentin.pra...@gmail.com>
Subject Re: Is their a straightforward way of calculating mean value?
Date Thu, 14 Oct 2010 09:29:42 GMT
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 <randall.leeds@gmail.com>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 <wanpeebaw@gmail.com> 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
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message