大家好,我想为我的消防站项目创建云防火墙索引,我不知道我应该上传到索引字段的哪个流,因为我在应用程序中出错了,上面写着:
W/Firestore(17047): (24.0.0) [Firestore]: Listen for Query(target=Query(chatRooms where participants.null == true order by __name__);limitType=LIMIT_TO_FIRST) failed: Status{code=PERMISSION_DENIED, description=Missing or insufficient permissions., cause=null}
W/Firestore(17047): (24.0.0) [Firestore]: Listen for Query(target=Query(users/2e5yO3ZYKDWprC8dVi1bzlY9a0Q2 order by __name__);这是我的溪流
QuerySnapshot snapshot = await _fireStore
.collection("chatRooms")
.where("participants.${userModel.uid}", isEqualTo: true)
.where("participants.${targetUser.uid}", isEqualTo: true)
.get();StreamBuilder(
stream: _fireStore
.collection('chatRooms')
.doc(chatRoom.chatRoomId)
.collection('messages')
.orderBy('createdon', descending: true)
.snapshots(),我不能发照片,因为至少需要10个名誉
规则:
发布于 2022-01-06 16:11:51
最简单的解决方案是使用包含直接链接的错误消息在Firebase控制台中创建缺少的索引。
正如文档中所解释的那样,“如果您尝试使用一个不映射到现有索引的range子句的复合查询,则会收到一个错误”。
因此,捕捉代码中的错误(通常使用if (snapshot.hasError),请参阅FlutterFire文档中的这里 ),获取消息并打开首选浏览器中的链接(登录到Firebase项目)。
在上面提到的doc页面中列出了其他解决方案,但是同样,在错误消息中的链接非常简单!
https://stackoverflow.com/questions/70609868
复制相似问题