title: tree structure with aggregated values on parent level
body: <p>I have read about the different models for storing tree-structured data and think that materialized paths or array of ancestors is the way to go in my case. </p>
  
  <p>But I would need some conceptual guidance so that I don't start out in a way that proves to be wrong at a later stage</p>
  
  <p>What I am aiming for is a structure like below with the aggregated values from subtrees present at the parent level. The blue dots represent departments and the figures below could represent department accounts. </p>
  
  <p>Could this be done only with queries or do I need to code it?
  Coming from a world of relational data...how should I model this? Is it two different collections, embedded documents or something else?</p>
  
  <p><a href="https://i.stack.imgur.com/Ue7eD.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ue7eD.jpg" alt="Desired structure"></a></p>