【发布时间】:2019-11-06 11:17:05
【问题描述】:
假设我有一系列汽车,我想按price 范围和year 范围过滤它们。我知道 Firestore 由于性能原因有严格的限制,所以类似于:
db.collection("products")
.where('price','>=', 70000)
.where('price','<=', 90000)
.where('year','>=', 2015)
.where('year','<=', 2018)
会抛出错误:
查询无效。带有不等式( 或 >=)的所有 where 过滤器必须位于同一字段中。
那么有没有其他方法可以在没有本地数据管理的情况下执行这种查询?也许是某种索引或棘手的数据组织?
【问题讨论】:
标签: firebase nosql google-cloud-firestore