【发布时间】:2018-04-27 14:05:05
【问题描述】:
我需要像这样获取范围数据。
ex) 10 < a < 20 , 30 < b < 40
a 和 b 两个字段现在都是索引键。
我认为在这种情况下复合范围查询是最简单的方法。
但在 Cloud Firestore 中,范围查询只能针对一个字段。
ex) (possible) citiesRef.where("state", "==", "CA").where("population", "<", 1000000)
(impossible) citiesRef.where("state", ">=", "CA").where("population", ">", 100000)
如何在 2 个字段中进行范围查询?
【问题讨论】:
标签: database firebase google-cloud-firestore