firestore-migrator
firestore-migrator copied to clipboard
Batch deletes of a collection
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 ?
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
.
i think a command line argument would be perfect. for example:
fire-migrate import --replace test.INDEX.csv myCollection
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