April 2018
Intermediate to advanced
284 pages
6h 43m
English
Firebase database rules are the only way to secure the data. Firebase provides flexibility and expression-based rules language with JavaScript-like syntax to developers to define how your data should be structured, how it should be indexed, and when the user can read and write the data. You can also combine authentication services with this to define who has access to what data and protect your users from unauthorized access. To validate the data, we need to add a rule separately using .validate in the rules.
Consider this example:
{"rules": {".write": true,"ticket": {// a valid ticket must have attributes "email" and "status"".validate": "newData.hasChildren(['email', 'status'])","status": {// the value of "status" must be ...