【发布时间】:2019-10-06 00:07:45
【问题描述】:
是否有可能基于多个 doc id 获得价值?
CollectionReference col1 = Firestore.instance
.collection('service');
col1.where("title", isEqualTo:"Ac replaciment")
.where("title",isEqualTo:"Oil Service")
.getDocuments()
这段代码没有给出任何结果
CollectionReference col1 = Firestore.instance
.collection('service');
col1.where("title", isEqualTo:"Ac replaciment")
.getDocuments()
这个代码我得到了结果
但是我的标题是“Ac replaciment”和“Oil Service”但是当我打电话更严厉时它没有给出结果
我需要查询 title =="Oil Service" or title =="Ac replaciment" 如何在 firestore 中使用颤振进行此操作
当我运行此代码时,它会从服务器返回所有数据
CollectionReference col1 = Firestore.instance.collection('service');
col1.where("title", isEqualTo: "Ac replaciment");
col1.getDocuments().
但我只需要在title=="Ac replaciment" 为什么会发生此问题时获得结果?正确的代码是什么?
【问题讨论】:
-
Cloud Firestore 不支持 OR 查询。常见的解决方法是为每个条件触发一个单独的查询,然后合并客户端。见stackoverflow.com/questions/47018212/…
标签: flutter google-cloud-firestore