can I get some documents from firestore simultaneously using Promise.all?

I want to get some documents from Firestore. in my callable cloud function, instead of waiting getting document one by one, await one by one, I use Promise.all so I can get all documents faster, like this and then I want to loop the document snapshots I just get, and here is the problem I have an error TypeError: Cannot read property ‘forEach’ of undefined what is wrong in here ? what should I do to get the documents that I just get from Firestore ? Answer The get() method returns a Promise that resolves with a QuerySnapshot. Since Promise.all()

Google Cloud Function async with multiple fetch requests

I’m new to both GCF and Javascript async and have been struggling with this. I perform a fetch call initially and then pass that response as a parameter to a second function which then also performs a separate fetch call. During the second function, my empty initialized json gets properties added to it, and when that function completes, I want to notify the exports.helloHttp to then do res.end and terminate. I’ve tried chaining an additional empty then() but it doesn’t seem to be working. My code: Answer Here is the code that would do what you want (replace the fetch