couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Shorin <kxe...@gmail.com>
Subject Re: Running total?
Date Tue, 31 Jul 2012 06:12:07 GMT
Hi,

Depends on your data, but just emit transaction id from set as key and
his amount as value with map and _sum these values with reduce
function. If you need totals for all set, then emit [set_id, item_id]
key and group results by specific level.

--
,,,^..^,,,


On Tue, Jul 31, 2012 at 6:38 AM, Samuel Williams
<space.ship.traveller@gmail.com> wrote:
> Hi,
>
> Given a set of transactions with each transaction having an integer amount
> or something similar, is it possible to generate a running total for each
> transaction using map-reduce in CouchDB?
>
> Kind regards,
> Samuel

Mime
View raw message