【发布时间】:2021-07-06 11:47:02
【问题描述】:
我正在尝试获取包含与用户位置匹配的位置字段的文档:
getLocationListings(placemark) async {
setState(() {
isLoading = true;
});
QuerySnapshot snapshot = await FirebaseFirestore.instance
.collectionGroup("posts")
.where('location', isGreaterThanOrEqualTo: placemark.locality)
.get();
setState(() {
posts = snapshot.docs.map((doc) => Post.fromDocument(doc)).toList();
isLoading = false;
});
}
我收到了错误:
Operation was rejected because the system is not in a state required for the operation's execution. If performing a query, ensure it has been indexed via the Firebase console.
我该如何纠正这个问题?
【问题讨论】:
标签: firebase flutter google-cloud-firestore