Firebase query on a large array -


currently, have database structure :

"companies": [     {       "address": "aa",       "branch": "bbb",       "id": 1,       "lat": "35.669648",       "lng": "139.785461",       "name": "gg",       "zip": "104-0051"     },     ....   ] 

i want develop function return companies in radius.

  • step 1: latitude,longitude device
  • step 2: retrive companies @ node "companies" firebase, loop lat,long. after that, calculation distance, check distance < radius return company.

the problem companies large array. seems bad solution if use loop. test on 150.000 records , takes ~40s. best solution requirement?


Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -