Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove all data from a Firebase database?

I started using a code that using Firebase realtime database. I implemented it to my solution. Connection and control was perfect, so I used it for the production environment.

After a while I was doing upgrade and I need remove all data again - but wait, there are no delete buttons in console anymore at highest root level and only allowed in one selected item at once:

https://console.firebase.google.com/project/{{project_name}}/database/data 

In last update shown only this message and no steps what next:

Read-only & non-realtime mode activated to improve browser performance Select a key with fewer records to edit or view in realtime

Q how can I remove all data at once?

like image 420
BGBRUNO Avatar asked Feb 11 '17 23:02

BGBRUNO


People also ask

How do I remove data from Firebase?

Sign in to Firebase, then open your project. , then select Project settings. In the Your apps card, select the app that you want to delete. Under the Your apps card, click Remove this app.

How do I delete all data on firestore?

To delete an entire collection or subcollection in Cloud Firestore, retrieve all the documents within the collection or subcollection and delete them. If you have larger collections, you may want to delete the documents in smaller batches to avoid out-of-memory errors.

How do I delete data from realtime database?

The simplest way for deleting data is to call removeValue() on a reference to the location of that data.


2 Answers

You can manually create a JSON file that contains a single empty entry and import it, which will remove all existing entries.

like image 105
Andrew Roberts Avatar answered Sep 20 '22 18:09

Andrew Roberts


A simple way to remove all data from a firebase database is to use the Firebase CLI.

Once the CLI is setted up you just need to use this command and your data will be removed :

firebase database:remove / 
like image 23
Charlouze Avatar answered Sep 18 '22 18:09

Charlouze