firebase - 您可以在复合查询中两次使用whereIn条件吗?

标签 firebase flutter dart google-cloud-firestore

是否可以在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 both in and array-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/

相关文章:

swift - Xcode 无法识别 FUITableViewDataSource

javascript - 提交后如何获取发布日期?

java - Android Studio-java.io.FileNotFoundException :(系统找不到指定的文件)并且无法提取JNI库

flutter - statefulWidget 无法进行所需更改的问题

firebase - 在 'default' 中找不到导出 'VueFire'(导入为 'vuefire')

android - flutter : RenderBox was not laid out: RenderRepaintBoundary#58c65 relayoutBoundary=up1 NEEDS-PAINT

dart - 在 Flutter 中,如何为无状态小部件定义基线?

asynchronous - 未取消 future

flutter - 使用flutter_bloc时清除文本字段

javascript - 类型错误 : Cannot read property 'uid' of undefined