title: Deleting a collection in Firestore - Flutter/Android
body: <p>I am new at flutter with firebase so if this feels like a question which has been answered in the docs or by other questions, I apologize!!</p>
  <p>Now I am saving user data in firestore and when a user deletes their account, I want that to be deleted too but the Firestore docs says that the only way to delete a collection us:</p>
  <blockquote>
  <p>To delete an entire collection or subcollection in Cloud Firestore,
  retrieve all the documents within the collection or subcollection and delete them.</p>
  </blockquote>
  <p>This is not recommended for native devs but I thought of an idea:</p>
  <p><strong>So firestore overwrites new data against the old one, so if we set a new collection (user-root) which has a single doc with no fields and then delete it, it would be read/write effective as it just overwrites all of the preexisting data.</strong></p>
  <p>I have not tried this idea out but if anyone has a better approach to delete collections in firestore, please write an answer!</p>
  <p><strong>Reference Links:</strong></p>
  <ul>
  <li><a href="https://firebase.google.com/docs/firestore/manage-data/delete-data#collections" rel="nofollow noreferrer">https://firebase.google.com/docs/firestore/manage-data/delete-data#collections</a></li>
  <li><a href="https://firebase.google.com/docs/firestore/manage-data/add-data#set_a_document" rel="nofollow noreferrer">https://firebase.google.com/docs/firestore/manage-data/add-data#set_a_document</a></li>
  </ul>