Limit the number of queried items from GeoFire

后端 未结 2 585
南笙
南笙 2021-01-15 09:37

I have a lot of entry in the same location. I would like only to get the 10 latest added items using Geofire. I know that it can be done easily with firebase using Query.lim

2条回答
  •  感动是毒
    2021-01-15 09:59

    There is no way to limit the number of keys from Geofire: it will return all keys that fall into the range you query for.

    The only thing I can think of is to not insert items if there is already another item in its vicinity. You're essentially clustering items while writing to the database in that case.

提交回复
热议问题