opened
MrMaxRoss
username_0
### Step 2: Describe your environment

  * Android device: Pixel running in the emulator on MacOS
  * Android OS version: 5.1.1
  * Firebase/Play Services SDK version: 11.8.0
  
### Step 3: Describe the problem:
Fire Eats has a menu item called "Delete All." When I select this option, the restaurants are deleted from the UI, which is great, but since it only deletes the restaurants and not the ratings (which are sub-collections), if you look at the Firestore db in the console you still see all the implicit restaurant ids and the ratings are still there. I think "Delete All" should actually delete all the data so that it's clean in the app but also clean in the database and the console.

#### Steps to reproduce:
  1. Set up Friendly Eats by following the instructions at https://github.com/firebase/quickstart-android/tree/master/firestore
  2. Start the app. I'm doing it in the emulator but running on a physical device will work fine too.
  3. Under the menu, select "Add Random Items."
  4. Look in the Firestore console. You'll see a collection called restaurants, and under each restaurant a sub-collection called ratings.
  5. Back in the app, under the menu, select "Delete All."
  6. Look in the Firestore console. You'll still see all the restaurant ids under the restaurants collection (grayed out and in italics because the restaurant documents no longer exist), and under each restaurant id you'll still see an actual ratings collection.
  
#### Observed Results:

  * The database is not empty.
  
#### Expected Results:

  * The database should be empty.
Firestore Sample Friendly Eats: Delete All menu option should actually Delete All
issue
created
samtstern
username_1
@username_0 thank's for filing this.  You're right about the ideal behavior.  This was mostly laziness, there's no easy way to implement "recursive delete" in the mobile SDKs and we didn't want to clutter up the quickstart with that kind of code.

I think the correct thing to do here is actually remove the "Delete All" button from the quickstart for the following reasons:

1. Reduce confusion about orphaned ratings
1. Tighten security rules in the sample by not allowing mobile deletes
1. Point users to the Firebase CLI or the Console for true "cleanup" deletes
comment
created
MrMaxRoss
username_0
That all seems reasonable to me, although the bulk delete code that's there
was still useful to see.
comment
created
samtstern
username_1
@username_0 I will make sure an equivalent snippet remains in the delete data docs if we make this change.
comment
created
samtstern
username_1
In #415 I am removing the client-side delete code. After some review I can't keep my promise from my previous comment, doing client-side deletes for many documents is pretty much always a bad idea so we have decided not to document any specific code for how to do it.  We don't want to lead developers down the wrong path
comment
closed
samtstern
username_1
issue