title: When filling an array from a Promise it appears as "empty" - firestore
body: <p>What I am doing is taking the invoices first to get their id and from there in another collection with a query I get the items that belong to that invoice and push it into the array.</p>
  <p>When an array is filled from a promise, it is shown as &quot;empty&quot; although it is not, since what is opened from the console shows if it has content (Images <a href="https://i.stack.imgur.com/UxrTj.png" rel="nofollow noreferrer">1</a> <a href="https://i.stack.imgur.com/BkaYz.png" rel="nofollow noreferrer">2</a>). And this is inside an asynchronous function (you shouldn't have problems with load times).</p>
  <p><strong>Async FetchItemsFromBills function</strong></p>
  <pre><code>let billItems = []
  
  const snapBills = await db.collection('bills').get()
  
  await snapBills.forEach(async x =&gt; {
     const snaps = await db.collection('items').where('billId', '==', x.id).get()     
        snaps.forEach(item =&gt; 
           billItems.push({
             ...item.data(),
             _id: item.id
           }))
        })
  
     console.log('Items', billItems);
     console.log('Items Length', billItems.length);
  
  </code></pre>
  <p><a href="https://i.stack.imgur.com/UxrTj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UxrTj.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/BkaYz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BkaYz.png" alt="enter image description here" /></a></p>