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.
When an array is filled from a promise, it is shown as "empty" although it is not, since what is opened from the console shows if it has content (Images 1 2). And this is inside an asynchronous function (you shouldn't have problems with load times).
Async FetchItemsFromBills function
let billItems = []
const snapBills = await db.collection('bills').get()
await snapBills.forEach(async x => {
const snaps = await db.collection('items').where('billId', '==', x.id).get()
snaps.forEach(item =>
billItems.push({
...item.data(),
_id: item.id
}))
})
console.log('Items', billItems);
console.log('Items Length', billItems.length);