When doing data export from Firestore to a bucket I am following the suggested solution on: Schedule data exports.
Some cherry-picked code from the solution is as follows:
const client = new firestore.v1.FirestoreAdminClient();
...
const projectId = process.env.GCP_PROJECT;
const databaseName = client.databasePath(projectId, '(default)');
return client.exportDocuments({
name: databaseName,
outputUriPrefix: bucket,
collectionIds: []
})
...
Now, with 2nd gen I know that e.g. project Id instead can be picked up using a pre-defined parameters from firebase-functions/params
But is there a new FirestoreAdminClient
that should/could be used to do databasePath()
and exportDocuments()
with?