Skip to content
Laran Evans edited this page Mar 27, 2016 · 1 revision

GQL supports nested AND and OR clauses using parentheses.

For example, take this SQL query:

SELECT * FROM posts WHERE created_at > '2016-01-01' AND (author_id = 5 OR featured = true)

We would write that in GQL like this:

created_at:>'2016-01-01'+(author_id:5,featured:true)

Clauses can also be negated by using the ! operator before the opening paren, like this:

created_at:>'2016-01-01'+!(author_id:5,featured:true)

Clone this wiki locally