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

Batch deletes of a collection #15

Open
SogoGolf opened this issue Oct 8, 2018 · 3 comments
Open

Batch deletes of a collection #15

SogoGolf opened this issue Oct 8, 2018 · 3 comments

Comments

@SogoGolf
Copy link

SogoGolf commented Oct 8, 2018

hi there, first a huge thank you for this great migrator lib. Has been massive time saver.

Is it possible to use firestore-migrator to do a batch delete of a collection, prior to running it for an upload ?

or is there a flag i can set so that if i re-run an upload to a collection, it will overwrite, not append the data (documents) to the collection ?

@stildalf
Copy link
Contributor

stildalf commented Oct 9, 2018

Good point, as it is now uploaded documents replace existing ones with the same ID, and there's the --merge option. But there's no way to prune excess documents or delete an entire collection prior to import - analogous to sql's TRUNCATE TABLE.

Have you thought of the best way to implement such a feature? Should we use a flag per collection, or every collection imported. Or perhaps a new cli option, such as --truncate path/to/collection.

@SogoGolf
Copy link
Author

i think a command line argument would be perfect. for example:

fire-migrate import --replace test.INDEX.csv myCollection

@samiq
Copy link

samiq commented Dec 12, 2018

if this is already fixed for, can someone close this ticket, I think it's important to keep this tidy to not give the wrong impression to people looking around this lib

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants