【发布时间】:2020-12-21 11:10:45
【问题描述】:
我想在 Firestore 查询中使用多个“where”过滤器,我的查询基于上述 example。
我的查询:
let colRef = firebase.firestore().collectionGroup('volumes')
colRef = colRef.where('days', 'array-contains', day)
colRef = colRef.where('start_time', '<=', time)
colRef = colRef.where('end_time', '>', time)
colRef = colRef.where('volume', '>', 0)
const snapshot = await colRef.get()
我收到上述错误:
错误:3 INVALID_ARGUMENT:不能对多个不等式过滤器 属性
我检查了compounding Firestore queries,发现:
您只能对单个字段执行范围(、>=)或不等于(!=)比较
这是对 Firestore 查询的巨大限制。我是否缺少实现该查询的另一个选项?
谢谢!
【问题讨论】:
标签: javascript node.js firebase google-cloud-firestore