f-miyu / Plugin.CloudFirestore

MIT License
121 stars 44 forks source link

Can't delete collections with subcollections #92

Open rezamohamed opened 2 years ago

rezamohamed commented 2 years ago

Following along the docs, using this

await CrossCloudFirestore.Current .Instance .Collection("yourcollection") .Document("yourdocument") .DeleteAsync();

I can't seem to delete the collection if there are nested collections below 'yourcollection'. How would I delete an entire Collection (including all sub-collections)?

vhugogarcia commented 2 years ago

You cannot do it. It is not per the plugin capabilities, but for firebase.

Firebase documentation says that you first need to delete all children collections and documents and then the parents.

rezamohamed commented 2 years ago

Ah gotcha, ok I iterated through the subcollection and deleted each document individually. Was hoping for a faster solution.

vhugogarcia commented 2 years ago

Yeah. I wish there is something like that. Hopefully, in the future Firebase provides that support.

Good luck!!