Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add feature to delete all documents in all collections or to replace when restoring #7

Open
3 tasks
willhlaw opened this issue Jan 30, 2018 · 0 comments
Open
3 tasks

Comments

@willhlaw
Copy link
Owner

willhlaw commented 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.

@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.

See reference docs for deleting in batch: https://firebase.google.com/docs/firestore/manage-data/delete-data#collections

Checklist

  • New option --delete to use with -a, --accountCredentials
  • New option --replace to use with -a2, --restoreAccountCredentials

Optional

  • Safeguards such as prompt user "Are you sure?" or ensure a backup is created before deleting
@willhlaw 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant