我在做一个查询
firestore().collection('stories')
.where('published', '==', true)
.where(firestore.FieldPath.documentId(), 'in', storyIds)
.get()我有关于故事的规则
match /stories/{storyId} {
allow read: if resource.data.published == true;
}如果我的列表中有未发布的故事的id,就会得到一个错误的firestore/permission-denied。我做错什么了?
更新
storyIds=["story2","story3"]修复文档
Story2

Story3

发布于 2022-04-28 08:36:59
我找到解决办法了。刚在文档中添加了我的documentId作为id并更改了查询。
firestore().collection('stories')
.where('published', '==', true)
.where('id', 'in', storyIds)
.get()现在起作用了。
https://stackoverflow.com/questions/72014633
复制相似问题