i've been working with firebase cloud functions and i ran into a trouble.
i wanna retrieve data from my firebase realtime database like this
function get(){
return firebase.database().ref('/state').once('value', (snapshot) => {
return snapshot.val();
});
}
but the proslblem is that when i call get() it immediately returns something like [object Promise]
because of the return firebase.database()...
is there a way how to return only snapshot.val()
??