Firestore数据库多范围查询错误

时间:2017-11-30 19:40:11

标签: javascript firebase google-cloud-firestore

我在Firebase Cloud Firestore上有一个数据库。我尝试使用范围比较通过2个单独的字段查询数据库。在Firebase中,我为它创建了一个索引。但出于某种原因,我收到了这个错误...

  

错误:查询无效。所有滤镜都有不等式(<,< =,>,   或> =)必须在同一个字段上。但是你有不等的过滤器   '纬度'和' Lng'

为什么我不能在2个字段上使用范围比较?有没有办法解决这个问题?

这是我的js查询代码......

db.collection("MyCollection")
.where("Lat", ">", 30)
.where("Lat", "<", 40)
.where("Lng", ">", 70)
.where("Lng", "<", 80)
.get()...

有什么想法吗?

0 个答案:

没有答案