【发布时间】:2021-11-26 18:07:53
【问题描述】:
大家好,在尝试打开带有查询的页面时,应用程序开始一次又一次地终止。我没有获得创建索引或类似内容的链接,它只是在 iOS 和 android 上终止,我收到以下错误。
这是代码
idofotheruser = await FirebaseFirestore.instance
.collection('meinprofilsettings')
.doc(user)
.collection('BlockedUser')
.limit(10)
.get();
idofotheruser.docs.forEach((element) {
listOfIds.add(element.id);
});
if (idofotheruser.docs.length > 0) {
print("test123");
print(widget.hashtag);
try {
querySnapshots = await FirebaseFirestore.instance
.collection('videos')
.where('uid', whereNotIn: listOfIds)
.where('Hashtagsforallvideos', arrayContains: widget.hashtag)
.orderBy("uid")
.limit(13)
.get();
An error occurred while parsing query arguments, this is most likely an error with this SDK.
E/FLTFirestoreMsgCodec(16249): java.lang.IllegalArgumentException: Invalid Query. You cannot use 'not_in' filters with 'array_contains' filters.
我也试过这样
await FirebaseFirestore.instance
.collection('videos')
.where('Hashtagsforallvideos', arrayContains: widget.hashtag)
.limit(15)
.get()
.then((value) => {
if (value.docs.isNotEmpty)
{
value.docs.forEach((doc) {
if (doc.data()['uid']) {
} else {}
// doc.data() is never undefined for query doc snapshots
}),
}
【问题讨论】:
标签: firebase flutter dart google-cloud-firestore