by devdoomari · 9y ago · 0 comments
e.g. can't query with age > 10 and have it sorted by age <-- (wrong example)
edit: see benjaminl's comment on the wrong example
CORRECT example: can't query with age > 10 and have it sorted by total_spent
It can do accomplish that query. From the docs a similar query:
citiesRef
.where("population", ">", 100000)
.orderBy("population")
.limit(2)
https://firebase.google.com/docs/firestore/query-data/order-...citiesRef.where("population", ">", 100000).orderBy("country")
is invalid...
EDIT: sorry got confused & posted wrong example (population/population vs population / country)
> Invalid: Range filter and first orderBy on different fields
But I can’t find any documentation on what exactly the limitations on orderBy are.
The reference docs on queries don’t mention any limitations on order_by: https://cloud.google.com/firestore/docs/reference/rpc/google...