我正在尝试仅为vip用户显示数据。我使用下面的代码,但每个用户都可以看到数据。
我想隐藏普通用户的演员数据并显示vip用户。
"tvshow1": {
".indexOn": ["actors"],
".read": "data.child('users').child(auth.uid).child('VIP').val() == 'Yes'",
".write": "data.child('users').child(auth.uid).child('VIP').val() == 'Yes'"
},
数据库结构:
tvshow1
| title:
| date:
| actors:
会员
|id:
|VIP:
你需要使用“root”
".read": "root.child('users').child(auth.uid).child('VIP').val() == 'Yes'"
写作也一样