Vikram Shinde
Vikram Shinde

Reputation: 1028

How to query NotEqual condition in GQL

I want to filter out some data. I tried different criterias How to query using GQL Not equal condition ?

Upvotes: 0

Views: 2528

Answers (1)

Joe Ceresini
Joe Ceresini

Reputation: 66

This isn't possible with Cloud Datastore. See the list of operators here:

https://cloud.google.com/datastore/docs/reference/gql_reference#operators_and_comparisons

Comparators are either equivalence comparators: =, IN, CONTAINS, = NULL, HAS ANCESTOR, and HAS DESCENDANT, or inequality comparators: <, <=, >, and >=.

This is also worth noting:

There is no way to determine whether an entity lacks a value for a property (that is, whether the property has no value). If you use a condition of the form property = NULL, what will occur is a check whether a null value is explicitly stored for that property. Datastore queries that refer to a property will never return entities that don't have a value for that property.

Upvotes: 1

Related Questions