1

In my Firebase DB I store cars and their keys are generated using childByAutoId. For example:

{
  “cars”: {
    "-JRHTHaIs-jNPLXOQivY": {
         …
     },
    "-JRHTHaKuITFIhnj02kE": {
        …
    }
  }
}

I am using GeoFire to query cars based on geographic location. Each location (created by GeoFire) use the same auto id as the key. After initial location query I want to retrieve information about the cars that the location query returned. Is there any way to specify a set of ids/values so I can get all data in one request instead of requisition one by one?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
sash
  • 8,423
  • 5
  • 63
  • 74
  • This question has been covered a few times recently. Firebase does not have an equivalent of `SELECT * FROM Cars WHERE ID IN [...]`. You will have to load each with a separate call. But that won't be significantly slower then an `IN` style query, since Firebase pipelines requests over a single connection. See http://stackoverflow.com/questions/35931526/speed-up-fetching-posts-for-my-social-network-app-by-using-query-instead-of-obse/35932786#35932786 – Frank van Puffelen May 08 '16 at 19:45
  • Thanks for the comment. Please post it as an answer and I will accept it. By single connection, do you mean socket connection? – sash May 08 '16 at 20:00
  • Yup. But if that is what you we're looking for, I'll mark this as a duplicate. – Frank van Puffelen May 09 '16 at 01:03

0 Answers0