title: How to update a quantity in another document when creating a new document in the firebase firestore collection?
body: <p>When I create a new document in the note collection, I want to update the quantity in the info document. What am I doing wrong?</p>
  
  <pre><code>exports.addNote = functions.region('europe-west1').firestore
    .collection('users/{userId}/notes').onCreate((snap,context) =&gt; {
      const uid = admin.user.uid.toString();
      var t;
    db.collection('users').doc('{userId}').collection('info').doc('info').get((querySnapshot) =&gt; {
      querySnapshot.forEach((doc) =&gt; {
        t = doc.get("countMutable").toString();
      });
    });
    let data = {
      countMutable: t+1;
    };
    db.collection("users").doc(uid).collection("info").doc("info").update({countMutable: data.get("countMutable")});
  });
  </code></pre>