Skip to content

Where is the documentation for Realtime Database inside Cloud Function? #1121

Answered by puf
sorcamarian asked this question in Q&A
Discussion options

You must be logged in to vote

The only thing that's specific to Cloud Functions there is how you get a reference to the database, for the rest it's just the regular JavaScript/Node.js SDK.

For getting a DB reference, you can either get it from the event that triggered the function (through event.data.ref.root) or by initializing the Admin SDK and then getting it from there.

If you tried this and can't get it to work, I recommend posting a minimal repro to one of the more support oriented communities, such as Stack Overflow or /r/Firebase on Reddit.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@puf
Comment options

Answer selected by puf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants