是否可以在Firestore的一个查询中两次使用whereIn
?像这样的东西
query.where('venue.id', whereIn: ['11','22','33',]).where('order',whereIn: ['Pending','Preparing']),
最佳答案
不,根据文档:
You can use only one in or
array-contains-any
clause per query. You can't use bothin
andarray-contains-any
in the same query.
另外,如果您有两个
whereIn
,它应该引发以下错误: if (operator == 'in') {
assert(!hasIn, "You cannot use 'in' filters more than once."); //this error
hasIn = true;
}
https://github.com/FirebaseExtended/flutterfire/blob/master/packages/cloud_firestore/cloud_firestore/lib/src/query.dart#L421
关于firebase - 您可以在复合查询中两次使用whereIn条件吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62968079/