我想根据 Firestore 中的用户位置获取商店。
Firestore 结构:
shopCollection
shopDoc1
city:"city",
address:"xyz",
lat:35,
long:25
shopDoc2....
我想检索距离用户较近的所有商店。我该怎么做?
最佳答案
无法简单地查询 Firestore 数据库并获取附近的所有商店。要解决这个问题,您需要使用一个库,为此我建议您使用 GeoFirestore for Android :
GeoFirestore is an open-source library for Android that allows you to store and query a set of documents based on their geographic location.
关于java - 如何根据 Firestore 中的位置获取数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54304987/