Skip to main content

Where Clauses

Where clauses allow you to filter subjects according to predicate ranges. You cannot use both from and where clauses in the same query.

Where clauses can use the following operations: >, >=, <, <=, and =.

For example, to select all movie's with budgets over $1,000, we could issue:

{
"select": ["*"],
"where": "movie/budget > 1000"
}

Note that in where clauses, you need to use the full, namespaced version of a predicate (i.e. movie/budget, not just budget).

You can string multiple filters together using AND or OR. You cannot use both AND and OR in the same clause.

For example, to get all movies with a budget over $1,000 AND under $10,000, we could issue:

{
"select": ["*"],
"where": "movie/budget > 1000 AND movie/budget < 10000"
}

Select all movies with budgets under $1,000 OR over $1,000,000