Google cloud firestore Firebase安全规则:如何在路径中使用破折号或连字符?
我找不到在Firestore安全规则路径中使用连字符或破折号的方法。我收到此错误消息:“意外的“-” 它仅在联机规则编辑器/模拟器中工作,但在尝试使用Firebase CLI部署.rules文件时出现错误(Firebase deploy--仅限firestore:rules) 我试着用单引号括住催眠的集合名称(路径)。我在网上找不到关于这个问题的任何信息Google cloud firestore Firebase安全规则:如何在路径中使用破折号或连字符?,google-cloud-firestore,firebase-security,Google Cloud Firestore,Firebase Security,我找不到在Firestore安全规则路径中使用连字符或破折号的方法。我收到此错误消息:“意外的“-” 它仅在联机规则编辑器/模拟器中工作,但在尝试使用Firebase CLI部署.rules文件时出现错误(Firebase deploy--仅限firestore:rules) 我试着用单引号括住催眠的集合名称(路径)。我在网上找不到关于这个问题的任何信息 service cloud.firestore { match /databases/{database}/documents {
service cloud.firestore {
match /databases/{database}/documents {
// Match any document in the 'oversea-users' collection
match /oversea-users/{oversea-user} {
allow read: ... condition ...;
}
}
}
我发现我的错误只出现在“catch”对象名中,而不是路径中。必须在{}之间使用OverseUsers而不是Overseas用户
service cloud.firestore {
match /databases/{database}/documents {
// Match any document in the 'overseaUsers' collection
match /oversea-users/{overseaUsers} {
allow read: ... condition ...;
}
}
}
我发现我的错误只出现在“catch”对象名中,而不是路径中。必须在{}之间使用OverseUsers而不是Overseas用户
service cloud.firestore {
match /databases/{database}/documents {
// Match any document in the 'overseaUsers' collection
match /oversea-users/{overseaUsers} {
allow read: ... condition ...;
}
}
}
大括号里的东西叫做“通配符”。大括号里的东西叫做“通配符”。