1

Hi suppose i have a mysql query like this

select * from table where (lat between 123 and 456) or (lng between 231 and 456)

what will the firebase equivalent for this query

dummy data in firebase looks something like this

[
 1:{
  con:"something",
  lat: 124,
  lng: 232
 },
 2:{
  con:"something",
  lat: 121,
  lng: 230
 },
 3:{
  con:"something",
  lat: 124,
  lng: 230
 }
]

The query should return the first and the third object i.e

[
 1:{
  con:"something",
  lat: 124,
  lng: 232
 },
 3:{
  con:"something",
  lat: 124,
  lng: 230
 }
]
Raj Nandan Sharma
  • 3,694
  • 3
  • 32
  • 42
  • 1
    Have you checked out this blog? https://www.firebase.com/blog/2013-10-01-queries-part-one.html I've personally have seen the severe limitations of firebase queries and if you want to start doing anything fancy the only alternative is to do a separate index on your data with a third party indexer such as Elastic Search. You've probably also noticed there isn't much in the way of chaining queries together. Alternatively, you could perform the OR operation on the client itself if you do not have a lot of data however this isn't scalable for large datasets. – TimD Sep 02 '15 at 20:07
  • @user1171911 that blog page was not useful. it had minimal queries with a single operation like between this and that. will look at elastic search though – Raj Nandan Sharma Sep 02 '15 at 20:11
  • 1
    possible duplicate of [OR queries in Firebase](http://stackoverflow.com/questions/28034092/or-queries-in-firebase) – Kato Sep 02 '15 at 20:16

0 Answers0