Closed ziquanc closed 6 years ago
@ziquanc please fill out the issue template.
This should now be fixed on the v3.0.x branch and will be included in our next release over the next couple of days.
If you'd like to try the latest code please use the following:
npm install --save https://github.com/invertase/react-native-firebase#v3.0.x
@ziquanc Were you able to get that type of query working? For me on the latest version of rnfirebase the query succeeds but my results only respect my latitude range, not my longitude range. I'm wondering if this is a limitation of firestore or I'm doing something wrong, thanks!
I'm also seeing latitude work but longitude not.
My results only respect my latitude range, not my longitude range. Has anyone come up with a solution or workaround?
We'll try and get round to testing this. In the mean time, could anyone debug on line https://github.com/invertase/react-native-firebase/blob/master/ios/RNFirebase/firestore/RNFirebaseFirestoreDocumentReference.m#L255 and check what the value of geopoint
is (NSDictionary
).
Anyone know if this was ever fixed on v4.0? I'm on v3.3, and it seems like longitude isn't working, and I'd like to know if it is worth upgrading to v4.0 at this time. Thanks.
any solution?
also interested to know when this will be resolved. i'm having to do an ugly workaround otherwise. does it by chance require creating an index on the geopoint field?
I'm afraid that this is an underlying limitation of Firestore as explained by Frank van Puffelen (puf on Twitter) who's part of the Firebase team: https://stackoverflow.com/a/46608540/5909648
Whilst Firestore allows storing of GeoPoints, querying against them is not officially supported.
I've had a check through our code and we are definitely passing the latitude and longitude through correctly to the native side, and taking a look online it looks like other people using the native libraries are experiencing the same issue: https://stackoverflow.com/a/46920982/5909648 (first comment)
The suggestion is to to filter for longitude on the client side having matched against latitude using Firestore directly.
ok. appreciate the update.
Would there be any way to make a query based on the coordinates and be able to paginate the result?
Issue
I am using firestore to query nearby location with geopoint, works fine in web sdk but not rnfirebase.
ref.where('location', '>=', lesserGeopoint).where('location', '<=', greaterGeopoint) .get() .then(function (querySnapshot) { if (querySnapshot.empty) { console.log('empty'); } ...
this code always return empty, I did try string fieldPath, works fine too. how can I make this works? thanks.
Environment
Application Target Platform: iOS Development Operating System: macOS Sierra Build Tools: iOS 10 Simulator React Native version: 0.49.3 RNFirebase Version: 3.0.5 Firebase Module: firestore