Back up comments and bets subcollections too

This commit is contained in:
Austin Chen 2022-01-25 15:13:11 -06:00
parent 8b9d0e5dba
commit a52b2992af

View File

@ -1,4 +1,5 @@
// Export script from https://firebase.google.com/docs/firestore/solutions/schedule-export // This code is copied from https://firebase.google.com/docs/firestore/solutions/schedule-export
// To deploy after any changes: `yarn deploy`
// To import the data into dev Firestore: https://firebase.google.com/docs/firestore/manage-data/move-data // To import the data into dev Firestore: https://firebase.google.com/docs/firestore/manage-data/move-data
import * as functions from 'firebase-functions' import * as functions from 'firebase-functions'
@ -20,12 +21,15 @@ export const backupDb = functions.pubsub
// Leave collectionIds empty to export all collections // Leave collectionIds empty to export all collections
// or set to a list of collection IDs to export, // or set to a list of collection IDs to export,
// collectionIds: ['users', 'posts'] // collectionIds: ['users', 'posts']
// NOTE: Subcollections are not backed up by default
collectionIds: [ collectionIds: [
'contracts', 'contracts',
'folds', 'folds',
'private-users', 'private-users',
'stripe-transactions', 'stripe-transactions',
'users', 'users',
'bets',
'comments',
], ],
}) })
.then((responses) => { .then((responses) => {