I've read multiple questions in Stack Overflow and the documentation but I couldn't find multiple validations that I can imagine that exist.
Per example, it is possible to check if request.resource.data.description is string
but can is it possible to do the same when it comes to number
, float
, timestamp
or even array
/list
? I couldn't even find the string
one in the documentation so I can imagine it is missing more than just that one.
Open the Firebase console and select your project. Then, from the product navigation, do one of the following: Select Realtime Database, Cloud Firestore, or Storage, as appropriate, then click Rules to navigate to the Rules editor.
Use the @firebase/rules-unit-testing module to interact with the emulator that runs locally. If you get timeouts or ECONNREFUSED errors, double-check that the emulator is actually running. We strongly recommend using a recent version of Node. js so you can use async/await notation.
The service cloud. firestore declaration scopes the rules to Firestore, preventing conflicts between Firestore Security Rules and rules for other products such as Cloud Storage. The match /databases/{database}/documents declaration specifies that rules should match any Firestore database in the project.
You might want to watch my video on data types in Firebase security rules. In it, I list all the different data types that you can check:
value is bool
value is int
value is float
value is number
value is string
value is list
value is map
value is timestamp
value is duration
value is path
value is latlng
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With