couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Metin Akat <akat.me...@gmail.com>
Subject Re: Tree structure: how to calculate branch node sum, using results from a view that calculates leaf node sums.
Date Thu, 03 Sep 2009 13:06:45 GMT
Well, there is a problem with this. I don't like the idea of recording
the whole path in each transaction, because it is anticipated that
accounts are able to change places in the tree. So my TRANSACTION only
holds information for only the "actual" account it's issued against,
not for its whole lineage.

On the other hand, ACCOUNTS do have the information for THEIR
path(lineage), exactly as you suggested.
So the problem now is making the connection between an account and its
balance :)


>
> query your reduce view with group_level=1 (or 2 or 3 .. depending on how
> many level you want to descend into your tree). Your "path" to the root node
> should be an array as in: ["toplevel", "firstlevel", "secondlevel"] as the
> key of your view.
>
> Cheers
> Jan
> --
>
>
>

Mime
View raw message