Firestore规则读取存在特定字段的文档
在我的用户集合
中,我有一些用户,其中存在一个称为startupdata
字段的字段,现在我想将这些文档公开。因此,我试图为此制定规则,但到目前为止没有运气。
这是我的文档。
这些是我到目前为止创建的规则
match /databases/{database}/documents {
match /users/{uid} {
allow read: if request.auth.uid == uid;
allow read: if get(/databases/$(database)/documents/users/{document=**}).data.startupData
}
}
In my users collection
I have a few users where a field is present which is called startupData
field and now I want to make these documents public. So I am trying to make rules for it but so far no luck.
This is my document with the field.
These are the rules that i have created so far
match /databases/{database}/documents {
match /users/{uid} {
allow read: if request.auth.uid == uid;
allow read: if get(/databases/$(database)/documents/users/{document=**}).data.startupData
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能需要使用
hasall
。You probably need to use the
hasAll
keyword.