title: Is it possible to run aggregation queries in Firestore?
body: <p>Stack:</p>
  
  <pre><code>Ionic
  Nodejs/Express
  Cloud Firestore
  </code></pre>
  
  <p>I am tasked with writing an app that takes dates in "day" format, with a balance for that day, and displaying that data in a chart using Chart.js. There are interval buttons that allow you to change between "day", "week", and "month" that is supposed to group the dates into respective intervals.</p>
  
  <p>This currently works fine using 1 collection. "days" and "weeks" both work, but once we get to "month" with large amounts of data Firestore kills itself in my backend. The amount of data it tries to poll is too large. I currently run aggregation for "weeks" and "months" in the backend using the "days".</p>
  
  <p>The only aggregation documentation I could find in the docs was: <a href="https://firebase.google.com/docs/firestore/solutions/aggregation" rel="nofollow noreferrer">https://firebase.google.com/docs/firestore/solutions/aggregation</a> which doesn't give me a result, it stores it in a collection which doesn't help me. The app can change the balance on a single date which causes a ripple effect in the balances after the fact - so I have to generate the values on interval change.</p>
  
  <p>Does something like this exist or am I stuck with creating 3 separate collections, days/weeks/months and polling the desired collection?</p>