MichaelSolati / geofirestore-js

Location-based querying and filtering using Firebase Firestore.
https://geofirestore.com
MIT License
505 stars 58 forks source link

If passing radius to geofirestore.collection, getting empty docs in response. #107

Closed prashantkumarjha47 closed 5 years ago

prashantkumarjha47 commented 5 years ago

If passing radius to geofirestore.collection, getting empty docs in response whereas if passing radius 0 getting all this.geofirestore = new GeoFirestore(this.firestore) this.query = this.geofirestore.collection("PassengerLocationDb").near({ center: new firebase.firestore.GeoPoint(35.17506145581017, 129.08302834244256), radius: 5 }) this.query.onSnapshot((docs) => { docs.forEach(doc => { console.log(doc.data()); }) }) Screenshot 2019-05-16 at 2 32 00 PM

MichaelSolati commented 5 years ago

Data and documents near to be structured in a special way in order to make queries. I'd recommend reading the thread in issue #81 to understand, but keeping it simple docs need to be created by geofirestore in order to be queried by geofirestore.