1

I have a firestore collections "users", which contains the following field I want to query:

"lat": 0.0, // some double value
"lon": 0.0, // some double value
"skills": [ // map of string to int
  {
    "skill": 2
  }
],
"interests": [ // list of strings
  "A",
  "B"
]

In my Android app, I plan to fetch users, which match the following query:

  • geocoordinate (lat, lon) are within a given radius (in km)
  • skills-map contains a key matching any element of a given list
  • Interest-list contains an element matching any element of a given list
  • These conditions should be and-connected

In the firestore documentation I unfortunately did not found an example/explanation how to build such a query.

Piwo
  • 1,347
  • 1
  • 12
  • 19
  • 2
    Geoqueries require two range operations (one for lat, one for lon), which isn't possible in the Firestore query model. That means that at the moment these queries won't be possible, even on your first requirement. See https://stackoverflow.com/questions/46607760/how-to-query-closest-geopoints-in-a-collection-in-firebase-cloud-firestore – Frank van Puffelen Dec 08 '17 at 14:26

0 Answers0