title: UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): ReferenceError: registrationTokens is not defined
body: <p>I get the above error when I try and use <code>Firestore</code> to get data - I am trying to retrieve tokens from my db so I can send messages:</p>
  
  <pre><code>exports.getUsers = functions.https.onRequest(async (req, res) =&gt; {
      db.collection("users")
          .get()
          .then(snapshot =&gt; {
              let registrationTokens = [];
              snapshot.forEach(doc =&gt; {
                  let id = doc.id;
  
                  registrationTokens.push(id);
              });
          });
  
      console.log(registrationTokens);
  
      const message = {
          data: { title: "Testing", body: "Test" },
          tokens: registrationTokens
      };
  
      messaging.sendMulticast(message).then(response =&gt; {
          console.log(response.successCount + " messages were sent successfully");
      });
  });
  </code></pre>