You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When migrating data or backing up and restoring data, we want to completely replace the database when restoring the data. So there should be an option to clear a firestore database. The option should be made clearly available as a standalone operation and an option when restoring data from disk or from another firestore instance.
@pmarconi Awesome. Something I'm wondering about is what will happen to new documents/fields and collections that have been added since the backup. Two options could be:
Replace: delete the entire target firestore db and completely replace it with the disk backup
Merge: merge the target firestore db with the disk backup
Perhaps this could be an additional command line argument. Personally I would rely on the merge for my project.
willhlaw
changed the title
Add feature to delete all documents in all collections
Add feature to delete all documents in all collections or to replace when restoring
Jan 30, 2018
When migrating data or backing up and restoring data, we want to completely replace the database when restoring the data. So there should be an option to clear a firestore database. The option should be made clearly available as a standalone operation and an option when restoring data from disk or from another firestore instance.
The idea is from this comment by @MrDrProfX.
See reference docs for deleting in batch: https://firebase.google.com/docs/firestore/manage-data/delete-data#collections
Checklist
--delete
to use with-a
,--accountCredentials
--replace
to use with-a2
,--restoreAccountCredentials
Optional
The text was updated successfully, but these errors were encountered: