I have 2 DB in the same project, and I need to trigger “onDocumentCreated” for a specific DB.
The problem is that this function has only 2 parameters :
- document — The Firestore document path to trigger on.
- handler — Event handler which is run every time a Firestore create occurs.
So I can not specify the DB instance for the document path.
Here is how I initialize my app :
const app = initializeApp(firebaseConfig);
const auth = getAuth(app);
const db = getFirestore(app);
const dbApplication = getFirestore(app, "application");
const dbUser = getFirestore(app, "user");