限制从GeoFire查询的项目数量 [英] Limit the number of queried items from GeoFire
问题描述
如果不可能,你有任何解决方法,我可以申请?
只有一个解决方案:
你应该开始一个半径小的查询,每次到达GeoQueryReady()(所有数据已经被加载) ,使用.setRadius(r)增加一小部分的地理位置,直到达到你想要的限制
基于这个 https://github.com/firebase/geofire-js/issues/59
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.limitToLast() but I don't know how to do it with Geofire.
If it is not possible, do you have any workaround that I can apply ?
There is only one solution for this :
you should begin a query with a small radius,
and each time you reach onGeoQueryReady() ("All data has been loaded"), you increase the radius by a small amount of the geoquery with .setRadius(r) until you reach the limit you want
based on this https://github.com/firebase/geofire-js/issues/59
这篇关于限制从GeoFire查询的项目数量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!