在firebase安全规则中,我们如何限制用户将多个数据推送到数据库?
我一直在尝试这个但是没有用
{
"rules": {
".read": false,
".write": false,
"voters": {
// restrict user to adding child more than one in this path
// one user only alowed to add one child
".read": true,
".write": "auth !== null",
".validate": "newData < 2",
"$votersuid": {
".read": true,
".write": "auth.uid == $votersuid",
}
},
}
}
答案 0 :(得分:0)
您可以在节点中添加布尔值,然后就可以像".write": "root.child('node_name').child('can_write').val() === true