Firebase数据库规则的语法错误 [英] Error in syntax on firebase database rules

查看:173
本文介绍了Firebase数据库规则的语法错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

{
"rules": {
    "Users": {
        "$user_id": {
            // grants write access to the owner of this user account
            // whose uid must exactly match the key ($user_id)
            ".write": "$user_id === auth.uid"
        }
    }
    "$businessName": {
        ".write": "root.child('Users').child(auth.uid).child($businessName).child('Permission    s').val() === 'MODERATOR'"
    }
}
}

这给我一个错误:保存规则错误 - 第10行:期望的','或'}'。这个错误说我缺少一个括号,因为某些原因我错过了一个逗号或者什么东西?

This is giving me an error: Error saving rules - Line 10: Expected ',' or '}'. The error says im missing a bracket for some reason did i miss a comma or something?

刚刚在$ businessName之前缺少逗号

As @Frank van Puffelen said i was just missing a comma before "$businessName"

这篇关于Firebase数据库规则的语法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆