title: How to fetch data from a Collection document onUpdate?
body: <p>I am trying to query data from a collection "users" in firebase onUpdate a document "bulkMsgs" but every time I do that I get "Error getting user".</p>
  
  <p>both methods are working separately fine but when I combine them the error is happening.</p>
  
  <p>What I am missing here?!</p>
  
  <pre><code>var functions = require("firebase-functions");
  let admin = require('firebase-admin');
  admin.initializeApp(functions.config().firebase);
  
      exports.bulkMsg = functions.firestore
          .document('/bulkMsgs/{bulkMsgsId}').onUpdate((snap, context) =&gt; {
  
              const newValue = snap.after.data();
              const regDate = newValue.regDate;
  
              admin.firestore().collection('users').get().then(onUser =&gt; {
                  onUser.forEach(oneUser =&gt; {
                      if (oneUser.data().notification === "true") {
                         console.log(oneUser.id);
                      }
                  });
                  return true;
  
              }).catch(err =&gt; {
                  console.log('Error getting user', err);
              });
  
  
              return true;
          });
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/y79W8.png" rel="nofollow noreferrer">Image</a> of the error in the CF log.</p>