title: Firestore Cloud Function empty collection
body: <p>I have a problem that's bugging me for days. I am trying to create a Firebase Cloud function that reads from the Firestore database.</p>
  <p>My Firestore DB looks like this:</p>
  <p><a href="https://i.stack.imgur.com/v8Xrb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/v8Xrb.png" alt="enter image description here" /></a></p>
  <p>Problem is that I cannot list <code>users</code> like this:</p>
  <pre><code>db.collection('users').get().then((snapshot) =&gt; snapshot.forEach(...));
  </code></pre>
  <p>If I try to do this I get empty response, like there are no users in my <code>users</code> collection.</p>
  <p>But I try to access user directly it works:</p>
  <pre><code>await db.collection('users/5CZxgu8nmNXu2TgplwOUdOIt8e33/receipts').get()
  </code></pre>
  <p>My complete code:</p>
  <pre><code>import * as functions from 'firebase-functions';
  
  const admin = require('firebase-admin');
  admin.initializeApp(functions.config().firebase);
  
  exports.cat = functions.https.onRequest(async (req, res) =&gt; {
      const receiptList: any = [];
      const db: Firestore = admin.firestore();
  
      const usersRef = await db.collection('users').get();
      console.log(usersRef.empty);        // Returns true
  
      const receiptsRef = await db
          .collection('users/5CZxgu8nmNXu2TgplwOUdOIt8e33/receipts')
          .get();
  
      receiptsRef.forEach((receipt: any) =&gt; {
          console.log(receipt);
          receiptList.push(receipt);
          // Here I can access data
      });
  
      res.send(receiptList);
      return '';
  });
  </code></pre>
  <p>Does anyone have any idea what I'm doing wrong? Thank you!</p>