geofirestore

Is there a way I can combine a GeoFireStore query with a normal Firestore query?

浪子不回头ぞ 提交于 2019-11-29 17:14:06
I want to query users which I have stored in a collection named "Users". Each user has fields such as age and weight. Is there a way I can query the users by distance from the user running the search with GeoFire and combine it with FireStore search queries? For instance, I am a user who is looking for someone who is in a 20 mile radius but also wants to find someone who is between 2 years younger or older than them. The Firestore database can filter on multiple fields, but it can only do a range filter on one of those fields. So this query is possible: collection.where("age", ">", 18).where(

Ordering Firestore GeoHash query from closest to furthest?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-29 17:00:07
Currently, I'm using parts of the GeoFirebase library along with Firestore to allow for geoquerying. When I set the geohash of a post, I do it as such if let geoHash = GFGeoHash(location: location.coordinate).geoHashValue { However, to make the geohash querying less specific, I'm planning on truncating part of the geohash when I query; currently, the query looks similar to this var geoQuerySpecific = GFGeoHashQuery() let geoQueryHash = GFGeoHashQuery.queries(forLocation: (lastLocation?.coordinate)!, radius: (30)) as! Set<GFGeoHashQuery> for query in geoQueryHash { geoQuerySpecific = query

In order to sort geoquery results by distance must I read the entire dataset?

女生的网名这么多〃 提交于 2019-11-28 12:32:17
问题 To perform geoqueries in Firebase or Firestore, there are libraries like GeoFire and GeoFirestore. But to sort the results of that geoquery by distance, the entire dataset must be read, correct? If a geoquery produces a large number of results, there is no way to paginate those results (on the backend, not to the user) when sorting by distance, is there? 回答1: No, a geo query doesn't read the entire result set. That wouldn't scale well at all. You might want to read up on how geohashes work if