title: update firestore document with cloud functions
body: <p>hello im trying to update document in firestore with cloud functions but im confused on how cloud functions know which document to update here is my code</p>
  
  <p>cloud functions code</p>
  
  <pre><code>exports.newsletterGreetConfirm = functions.firestore
    .document('newsletter/{newsletterId}')
    .onUpdate((change, context) =&gt; {
      const newValue = change.after.data();
      console.log(newValue);
      return 0;
    });
  </code></pre>
  
  <p>in my cloud functions shell ill pass the following object to my <code>newsletterGreetConfirm</code> function</p>
  
  <pre><code>{email:"test@gmail.com",id:"LgNqtD6Ih7SYPEEz8jJl",subscribedToNewsletterList:true,timestamp:12321312}
  </code></pre>
  
  <p>my output is <code>undefined</code> <br>
  my goal is to confirm email addresses whenever a user clicks a button or link in their confirmation email. just in the first phase of building this functionality thanks for all the help! also im using <code>react</code></p>