firebasefirebase-realtime-databasefirebase-console

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?


Solution

  • Why missing Firebase remove button ?

    Alvin from Firebase Support :

    Record or node has too much data, which makes the data viewer switch to a read-only/non real time mode to increase the browser's performance.


    Remove all data from Firebase from command line

    Firebase documentation show Removing Data - just they don't show how remove all data.

    For remove all data you can use REST command - which remove whole JSON output on that node level

    curl -X DELETE "https://{{project_id}}.firebaseio.com/.json"
    

    so you can do this on every generated "URL node in console" by adding JSON extension

    https://{{project_id}}.firebaseio.com/{{path}}/{{path}}/{{path}}/.json