gpt4 book ai didi

ios - GeoFire 和 Firebase 查询

转载 作者:行者123 更新时间:2023-11-28 21:30:38 25 4
gpt4 key购买 nike

我对使用 GeoFire 结果查询 Firebase 的正确方法有点困惑。

阅读 GeoFire 的说明,我应该在树中将位置和用户数据分开。所以我有以下内容:

-location
- userID
- g
- l
- 0:lat
- 1:long

- user
-userID
- ...

使用 Geofire 查询,我有一组附近的用户 ID。这是我感到困惑的地方,我没有看到 Firebase 查询项目数组的任何方法。我想检索数组中每个用户的用户数据。

我可以遍历列表并发出多个请求,但这似乎是获得所需结果的低效方法。

最佳答案

I don't see any methods for Firebase to query an Array of items. I would like to retrieve the user data for every user in the array.

确实没有这样的要求。

I could loop through the list and make multiple requests, but that seems to be an inefficient way to get the desired results.

虽然它看起来效率低下,但实际上并非如此。这样做的原因是 Firebase 在加载多个项目时非常高效,因为它通过同一个 Web 套接字检索所有项目并通过管道传输请求。

有关更详细的解释,请参阅 Speed up fetching posts for my social network app by using query instead of observing a single event repeatedly

关于ios - GeoFire 和 Firebase 查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36211141/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com