0

I want to fetch shops on the basis of user location in Firestore.

Firestore structure:

shopCollection
        shopDoc1
            city:"city",
            address:"xyz",
               lat:35,
               long:25
        shopDoc2....

I want to retrieve all the shops that are near to user with distance. How can i do this?

Alex Mamo
  • 130,605
  • 17
  • 163
  • 193
user7411343
  • 163
  • 1
  • 1
  • 9

1 Answers1

1

There is no way to simply query the Firestore database and get all shops that are nearby. To solve this, you need to use a library and for that I recommend you to use 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.

Alex Mamo
  • 130,605
  • 17
  • 163
  • 193