The kind of data I am working with:
"places" : {
"place_1" : {
"lat" : 10,
"lng" : 20,
},
"place_2" : {
"lat" : 12,
"lng" : 22
},
"place_3" : {
"lat" : 15,
"lng" : 25
}
}
I want to query for places which are near to a given location i.e. in +-2 lat lng of the some coordinate. Lets say my location is lat=11,lng=23
. So want to do something like
placesRef.orderByChild("lat")
.startAt(9)
.endAt(13)
.orderByChild("lng")
.startAt(21)
.endAt(25)
This would return me "place_2". But Firebase doesn't support ordering for multiple children, so I want some alternate way in which I can accomplish this task. I cannot think of a combined key which would help me query the way I want.