I was wondering what the best way to delete my collection (which has subcollections) in firestore is. I need to delete the entire collection (using code such as this https://firebase.google.com/docs/firestore/solutions/delete-collections) every day at 20:00 UTC.
My concern is that users will be able to query/write documents to the collection/sub-collection that is being deleted. If they try to read/update/delete a document in the collection while the batch delete is running will this cause any problems?
I have thought of somehow writing some firestore rules that blocks reads if the query time is 20:00 - 20:05 UTC but it seems a bit hacky and I am not sure if it's even possible.
Could anyone provide me some assistance with how to handle potential reads at the same time as the batch delete.
Thanks a lot
Side note : In the delete collections code it mentions a token that is required functions.config().fb.token
. Is this always the same If the code is running on cloud functions?