The documentation here says that it doesn't, but is this up to date?
Is this also true when you delete a collection through the GUI? And yes I am aware you can do it with cloud functions.
The documentation here says that it doesn't, but is this up to date?
Is this also true when you delete a collection through the GUI? And yes I am aware you can do it with cloud functions.
Yes, the document you’ve mentioned is updated. And no, deleting a document in Firestore does not delete its subcollections. While deleting the document in Cloud Firestore, the subcollections won’t be deleted automatically. You have to delete them manually instead.
For deleting a whole collection/subcollection, retrieve all the documents within the collection/subcollection and delete them. For larger collections, delete the documents in smaller batches to avoid out-of-memory errors. Repeat the process until you've deleted the entire collection/subcollection. The recommended approach to delete a collection in production is by using a callable function like you’ve mentioned in your question that you’re aware of it.
You can also delete the data with the help of the Firebase Console. Deleting a document from the Console deletes all of the nested data in that document, including any subcollections.
Also, you can delete documents and collections from Firebase CLI by using the command mentioned below.
firebase firestore:delete [options] <<path>>
Yes, that's accurate.
Deleting a document does not delete subcollections.
You will see an option to delete subcollections in the Firestore Emulator, but it's not possible in production.
This post answer to this problem How to recursively delete collection in firestore? How to recursively delete collection in firestore?
const db = admin.firestore()
const ref = db.collection(collectionId).doc(documentId)
await db.recursiveDelete(ref)