Firestore database multiple range query error

2019-08-10 02:11发布

I have a database on Firebase Cloud Firestore. I'm trying to query the database by 2 separate fields using range comparisons. In Firebase I created an Index for it. But for some reason, I'm getting this error...

Error: Invalid query. All where filters with an inequality (<, <=, >, or >=) must be on the same field. But you have inequality filters on 'Lat' and 'Lng'

Why can't I use range comparisons it on 2 fields? Is there any way around this?

Here is my js query code...

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

Any ideas?

0条回答
登录 后发表回答