Reputation: 59
Why is a return statement necessary to read data from firestore? When I use let userRef.get()... nothing is printed to the console.
Thanks.
Upvotes: 0
Views: 68
Reputation: 664444
In a google cloud function, you need to return a promise for the result of your function. If you do something asynchronous (like reading from firestore) and do not return the appropriate promise, the runner kills your function before it has finished.
Upvotes: 3