title: Firestore data aggregation of documents
body: <p>I'm creating an expense tracker app, where the user can set a monthly budget (ie. $3,000) and a  field 'total spending for the month' would update each time a user adds an expense. How would I do this using Firestore Database? So far, I have the expense record stored in a subcollection inside a document (using user-id) inside a user's collection.</p>
  <pre><code>  expenseForm.addEventListener('submit', e =&gt; {
      e.preventDefault();
      db.collection('users').doc(user.uid).collection('expense-record').doc().set({
        title: expenseTitle.value,
        amount: expenseAmount.value,
        category: expenseCategory.value,
        date: expenseDate.value,
      });
    });
  </code></pre>