Closed generalomosco closed 5 years ago
Hmmm this issue does not seem to follow the issue template. Make sure you provide all the required information.
Hey there! I couldn't figure out what this issue is about, so I've labeled it for a human to triage. Hang tight.
What the error message is telling you is that if you're using a where clause with an inequality, your first order by must be on the same field.
This is a limitation of the way indexes work in Firestore: in order to evaluate the inequality, we must perform a scan on an index where that field is in the first position. In other words: the results are going to be ordered by that field, all you get to choose is if there are any other orderings you want to apply after that.
I'll also point out that using inequalities on geopoints like you are doing is not going to work as expected. It'll essentially only filter by the latitude, not the longitude (see https://github.com/firebase/firebase-js-sdk/issues/826 for another discussion about this). Unfortunately we do not yet support proper geo queries.
Is there anyway i can escape GeoPoint as first order in this postion? If i remove GeoPoint from orderby it triggered the below error and if i put the GeoPoint as first orderby, as instructed as below, it mislead the second orderby priceSort..
Please one can try it here as same as this, i want the index to order accordingly by numeric jsbin.com/dekafuvevo/1/edit?js,console