Batch write with Firebase Cloud Functions
As you already guessed, the call customerQuery.get()
returns a promise.
In order to understand what you need, you should first get familiar with the concept of promises here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
For your use case, you will probably end up with either using the then
callback:
customerQuery.get().then((result) => {
// now you can access the result
}
or by making the method call synchronous, by using the await
statement:
const result = await customerQuery.get()
// now you can access the result