Query Google Firestore database by custom object fields

前端 未结 2 1188
生来不讨喜
生来不讨喜 2021-01-19 17:47

I\'ve got the following Google Firestore database structure:

Is there a way to query by a range of each - latitude and longitude? For example I want to get all user

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-19 17:55

    Maybe a solution for this is to have a cloud function that adds a lat_range and a lon_range field to each document as it comes into Firebase? You'll need to have predefined ranges though - so you know what you can query.

提交回复
热议问题