firebase-functions
firebase-functions copied to clipboard
Please disambiguate Realtime DB and "Database"
Please rename firebase-functions/v2/database to firebase-functions/v2/realtime or onValue* triggers to onRealtimeValue*. This will save hours to your future clients!
[REQUIRED] Version info
node: 16
firebase-functions: 3.23.0
firebase-tools: (don't remember, should be latest)
firebase-admin: 11.0.1
[REQUIRED] Test case
It appears that internally Firebase team calls Realtime Database a "database" and Firestore something else. Unfortunately, it is not
[REQUIRED] Steps to reproduce
- Import
firebase-functions/v2/database - Use
onValueUpdatedtrigger
[REQUIRED] Expected behavior
Trigger would react on Firestore changes
[REQUIRED] Actual behavior
Trigger is only for Realtime DB.
Were you able to successfully deploy your functions?
I found a few problems with this issue:
- I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
- This issue does not seem to follow the issue template. Make sure you provide all the required information.
Hi @eugeneo! Unfortunately, CF3v2 (i.e. GCF Gen 2 and EventArc) does not support Firestore as a trigger yet. When it becomes available, you will be able to create a Firestore triggers by importing various functions from firebase-functions/v2/firestore.
As for the suggested name change - we haven't considered changing the name (to something like firebase-functions/rtdb?). True that it is bit of a historical relic 🤔 but we didn't consider it confusing especially for existing CF3 users. I see why new users might find it confusing.
Yes, I figured out that v2 functions can not be triggers. That's fine. This issue is specifically to make the names less ambiguous.
The errors I was getting were not helpful either - my project does not use RT DB so I was getting something like "missing namespace" as a deployment failure.
The Firebase Realtime Database was the original Firebase product as a whole, let alone predating Firestore, so the client and admin SDK for JS put the realtime database SDK in the "database" namespace. We consider consistency to be a key feature of the SDK, so we will always put the realtime database in the "database" namespace unless or until the other SDKs make the same change.