One thing that was helpful for me was to go to the Cloud Functions section for my Firebase project, hop over to the GCP console side of things, and download a zip of the source code deployed for my ext-firestore-bigquery-export-fsexportbigquery
function.
In there, I noticed that the value of process.env.COLLECTION_PATH
ultimately gets passed through to functions.firestore.document()
which is just constructing a namespaced collection path, where wildcards can be used at any level in the path...and therein lies the magic.
If you set your Collection Path to simply be a wildcard variable, such as "{AnyCollection}", then the function will capture events for any and all collections in your Firestore DB. Only one instance of the extension is needed.
Overall solution:
- Set Collection Path to "{AnyCollection}"
- Set Table ID to something indicating that it's multi collection, such as "AnyCollection"
- It can be helpful to set Wildcard Column field with Parent Firestore Document IDs to true, although not required.
- You also could interrogate the name of the collection out of the
document_name
column in your BigQuery table, which includes paths such as "projects/my-firebase-project/databases/(default)/documents/my-firestore-collection/U5OeEv7jZCY8ja0g2gLr".