Appreciating that firebase has added support for promises, is there a way to run a query like the following inside of an async
function?:
const eventref = this.db.ref('cats/whiskers');
const value = await eventref.once('value')
Running the above returns a promise for value
, I'm hoping to get the json blob that is stored at cats/whiskers
.
The result of value
is a snapshot, we need 1 more step to get the value. This should be like:
const eventref = this.db.ref('cats/whiskers');
const snapshot = await eventref.once('value');
const value = snapshot.val();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With