Reputation: 1079
I think there is an issue with firebase firestore code base for error logging. I'm getting:
Invalid query.... You have a where filter with an inequality (<, <=, >, or >=) on field 'myDocField' and so you must also use 'myDocField' as your first argument to Query.orderBy(), but your first orderBy() is on field 'someOtherDocField' instead.
However, my query is using the "!=" evaluation and no greaterThan/lessThan checks.
So my query is :
myQuery = myReference.where("myDocField", "!=", 0).orderBy("someOtherDocField");
And it plays nice and just wants a composite index when I do:
myQuery = myReference.where("myDocField", "!=", 0).orderBy("myDocField").orderBy("someOtherDocField");
My firebase version is 6.14.10.
So I guess my specific question is why am I getting this error?
Upvotes: 4
Views: 1349
Reputation: 598728
Naming wise it makes sense that !=
is also considered an "inequality" that the message talks about, especially since following the guidance in the error message seems to make it disappear.
My guess is that the error message hasn't been updated for the addition of !=
queries. It might be worth reporting this issue on the Github repo of the SDK.
Upvotes: 1