Deleting Firestore Documents

Deleting documents in your Firestore collection requires that you have a Button or Touchable component to submit the deletion request.

On the Button/Touchable you want to use to submit the deletion request, navigate to the "Interactions" tab in the right-hand panel and click the "+" to add an Action. In the drop down, select "Firebase Request."

Inside the Firebase Request "Setup" config, select "Request" and within that dropdown, select "Delete Document."

You can also add a name for this request, but that is not required.

Then navigate to Firebase Request "Configurations" section and select the collection and the ID of the document you want to delete.

Here's an example of a how to configure this using a Button component to delete a document.

Inside the Navigate "Basics" config, select the screen you want to navigate to from the "Destination" drop down.

In the "Pass Data" config, select the document id or field you want to pass with the navigation by typing it or using the dropdown. In the input to the left, enter the component field name you want your selected document id/field to map to.

Here's an example of using a Button component to pass the id of a new Firestore document to a "Done" screen to confirm to the user that their document was created successfully.

Did this page help you?