mbouclas / loopback-ds-tree-mixin

Transform a loopback model into a tree using the Array of Ancestors pattern
MIT License
6 stars 4 forks source link

Aggregating Count of leaf nodes up in parents #20

Open haresh333 opened 5 years ago

haresh333 commented 5 years ago

I have build a hierarchy of nodes - say City-->Area-->SubArea-->Building-->Shop1, Shop2, Shop... Shop is a leaf node.

  1. I want to count number of shops in each building, then total shops in each subarea/area/city

  2. Leaf Node Shop may have attribute say -Shop Type = food, grocery, hotel. Also I would like to count of the food-shops in a city.

How this can be done?