how to change the realtime database securtiy rule from start in locked mode to start in test mode in firebase

29 Views Asked by At

Accidentally started the Firebase Realtime Database in locked mode instead of test mode. Is it possible to change that? Otherwise, how can we see the tree and its nodes as structured by the code? As in my app, I have entered the user's details. Which I want to see.

Unable to delete or disable. Need assistance to switch to test mode for viewing data structure.

1

There are 1 best solutions below

3
Alex Mamo On

Is it possible to change that?

Yes, it is possible. What I recommend you, is to find a date and add the corresponding timestamp inside the rules:

{
  "rules": {
    ".read": "now < 1725090876000",  // 2024-8-31
    ".write": "now < 1725090876000",  // 2024-8-31
  }
}

I picked an arbitrary date, which is 2024-08-31. These rules will allow you to read and write data until the 31st of August, 2024. Please also remember, if you go with your app into production, don't forget to secure your database using Firebase Realtime Database Security Rules.