Skip to content
Laran Evans edited this page Mar 27, 2016 · 1 revision
GQL JSON SQL
! {$not: <condition>} NOT

All comparison operators can be negated.

In GQL

Negate in GQL using ! before the property (e.g. !title:Foo means NOT title = 'Foo'). Always remember that the ! goes before the property and not the value.

In JSON

Negate in JSON using $not (e.g. {$not: {title: 'Foo'}}).

Negating Clauses

Entire Clauses can be negated using the same syntax.

For example:

GQL JSON SQL
!(created_at:>=\'2015-01-01\'+created_at:<\'2016-01-01\') {$not: [{created_at: {$gte: '2015-01-01'}}, {created_at: {$lt: '2016-01-01'}}]} NOT (created_at >= '2015-01-01' AND created_at < '2016-01-01')
Clone this wiki locally