Accessing nested data for conditional with authenticated user
firebase
Solution
You need to add .val() after .child() in order to get the value out. :-) Try:
".read": "data.child('members').child(auth.uid).val() == true"
Problem
I'm trying to make new post objects readable only by users that exist in the 'members' dictionary stored in each post. I keep getting "7:17: Invalid == expression: left operand is not a number, boolean, string, or null." on the .read rule: ``` { "rules": { "posts" : { ".write":true, "$post" : { ".read": "data.child('members').child(auth.uid) == true" } } } } ``` I pass the 'uid' parameter in the token I generate per: https://www.firebase.com/docs/security/custom-login.html The purpose is to only allow posts to be read by users that exist in its member array. I can't find any examples about accessing nested data in the firebase documentation, google groups, or google searches :-( Is this allowed/possible?