【发布时间】:2022-01-06 15:56:41
【问题描述】:
大家好,我想为我的 Firestore 项目创建云 Firestore 索引,但我不知道应该将哪个流上传到索引字段,因为我在应用程序中遇到错误:
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 个声望
规则:
【问题讨论】:
标签: firebase flutter google-cloud-firestore