I know Cloud Firestore stores locations based on latitude and longitude in Geopoints. However, I can't find a method or a way documented to query documents based on the distance to a certain point, kind of what GeoFire does for the Realtime database.
Is there a way to achieve that?
Before you use Cloud Firestore, you must choose a location for your database. To reduce latency and increase availability, store your data close to the users and services that need it. This location setting is your project's default Google Cloud Platform (GCP) resource location.
Saving Geolocation Data in FirestoreYou name the object whatever you want and save multiple points on a single document. The library provides a the point method to help you create this data. If updating an existing doc, you can use setPoint(id, lat, lng) to non-destructively update the document.
Cloud Firestore is Firebase's newest database for mobile app development. It builds on the successes of the Realtime Database with a new, more intuitive data model. Cloud Firestore also features richer, faster queries and scales further than the Realtime Database. Realtime Database is Firebase's original database.
It's something we're looking into, but isn't supported at this time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With