I want to perform orderyBy "commentedBy" field and "geoHash" field together. Since firestore doesn't allow multiple orderBy on not equals operator. Is there any way to perform this query?
I'm trying to show all nearby posts which is not already commented by current user.
My code is below:
query
.collection("posts")
.orderBy("commentedBy")
.whereNotIn("commentedBy",listOf(FirebaseAuth.getInstance().currentUser!!.uid))
.whereEqualTo("disabled", false)
.whereEqualTo("expired", false)
.orderBy("geoHash")
.whereGreaterThanOrEqualTo("geoHash", boundingBox.minimumMatch)
.whereLessThanOrEqualTo("geoHash",boundingBox.maximumMatch)distanceForRadius)
Yes it is possible. After making your query, run your code and you will encounter an error, if you want with log or if you want, find that link in the build section and click it. Confirm it. After the build process is finished, run the application again.