Firebase流行规则不使用更新的firebase
我正在尝试使用
{“规则”:{“ Read”:true,“ .write”:true}}
每次我放入时,我获取
“不匹配的输入'{'期望{'function','import','service','rules_version'}“
我当前的规则是
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if true;
}
}
}
I'm trying to use the most popular/common firebase rule of
{ "rules": { ".read": true, ".write": true } }
Every time I put it in, I get the error of
"mismatched input '{' expecting {'function', 'import', 'service', 'rules_version'}"
My current rule is
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if true;
}
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您要输入的是实时数据库的安全规则,但是您正在尝试将其输入Cloud Firestore,这是另一个数据库。虽然两个数据库都是火箱的一部分,但它们是完全分开的,并且一个数据库的安全规则不适用于另一个。
要解决错误,您将必须设置云firestore的规则,如所示”这里和在这里。
What you're trying to enter are security rules for the Realtime Database, but you're trying to enter them for Cloud Firestore, which is another database. While both databases are part of Firebase, they're completely separate, and the security rules for one don't apply to the other.
To fix the error, you will have to set the rules for Cloud Firestore, as shown here and here.