I am trying to filter data in firestore and display it in my application. I can see "where Equal To" condition in firestore api but I need "where not Equal to".
How can I do that?
I am trying to filter data in firestore and display it in my application. I can see "where Equal To" condition in firestore api but I need "where not Equal to".
How can I do that?
You can see from the docs that Where
queries do not have a not equal to
operator, so this is not possible
The where() method takes three parameters: a field to filter on, a comparison operation, and a value. The comparison can be <, <=, ==, >, >=, or array-contains. For iOS, Android, and Java, the comparison operator is explicitly named in the method.
I would suggest trying to structure your data in a way that there is an alternate field that stores some sort of boolean value for use in your query. Alternatively you could just get the full collection and filter out after. Assuming we are talking about a single doc this shouldn't be much more expensive as an operation