Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase - add database rules - Path contains invalid characters

I'm following the tutorial of firebase. But I can´t add the rules .read and .write

enter image description here enter image description here

like image 398
Ricardo Avatar asked Sep 28 '16 06:09

Ricardo


People also ask

How do I change the Realtime Database rules in Firebase?

Edit and update your rulesOpen the Firebase console and select your project. Then, select Realtime Database, Cloud Firestore or Storage from the product navigation, then click Rules to navigate to the Rules editor.

Is Firebase better than MongoDB?

Both Firebase and MongoDB are modern post-relational databases that allow for flexibility and speed to market, while Firebase is more popular for smaller applications, and MongoDB moreso for big data and high-performance use cases.

What file should be used for Realtime Database security rules?

To access your rules from the Firebase console, select your project, then in the left-hand navigation panel, click Realtime Database. Click Rules once you're in the correct database or storage bucket. To access your rules from the Firebase CLI, go to the rules file noted in your firebase. json file.

How do I set rules in Firebase database?

These rules are hosted on Firebase servers and are applied automatically at all times and you can change the rules of your database in Firebase console. You just have to select your project, click on the Database section on the left and select the Rules tab.


1 Answers

This is happening because the path that includes the key CANNOT have "." period marks according to this link.

As all Firebase Realtime Database data is stored as JSON objects, when you create your own keys, they must be UTF-8 encoded, can be a maximum of 768 bytes, and cannot contain ., $, #, [, ], /, or ASCII control characters 0-31 or 127. You cannot use ASCII control characters in the values themselves, either.

I wish this helps you.

And if you want to deal with RULES follow what IGOR said. Best regards.

like image 182
Dimitri de Jesus Avatar answered Sep 22 '22 08:09

Dimitri de Jesus