firebase realtime database rules according to another value code example
Example: firebase realtime database rules
10 Firebase Realtime Database Rule Templates
https://medium.com/@juliomacr/10-firebase-realtime-database-rule-templates-d4894a118a98