couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Hahn <m...@hahnca.com>
Subject Re: Reducing/Grouping an array
Date Mon, 11 Jun 2012 17:58:34 GMT
map-reduce works on all types of obects or even lists of types

On Mon, Jun 11, 2012 at 3:39 AM, Robert Newson <robert.newson@gmail.com>wrote:

> Sure, the built-in _sum reduce function works for lists of numbers too.
>
> B.
>
> On 11 Jun 2012, at 11:29, Rory Franklin wrote:
>
> > Hi,
> >
> > Is it possible to have a view that emits out something like the
> following:
> >
> > ("key1", [1,1,0,1])
> > ("key1", [1,1,1,0])
> > ("key1", [1,0,0,0])
> > ("key2", [0,1,0,0])
> >
> > which can be grouped to the following:
> >
> > "key1", [3,2,1,1]
> > "key2", [0,1,0,0]
> >
> >
> > Or would this calculation have to be made in the application layer?
> >
> >
> > Thanks,
> > Rory
>
>

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