Skip to main content
The WHERE clause is optional and is used to filter results based on predicates (conditions).

Supported Comparison Operators

Combining Predicates

Predicates can be combined using the logical operators AND, OR, and NOT. Use parentheses to control precedence when combining multiple predicates.

Examples:

Inline Property Filters

You can specify equality predicates directly within node patterns using curly braces:
This requires that the president node’s name property equals “Jed Bartlett”. Inline predicates are functionally equivalent to predicates specified in the WHERE clause.

Pattern Predicates

You can also filter based on graph patterns. These two queries are equivalent and both return presidents and the states they won:
Pattern predicates can be negated and combined with logical operators. This query returns presidents who did not win in states where they were governors:

Label Filtering

Nodes can be filtered by label in the WHERE clause:
Best Practice: When possible, specify labels directly in the node pattern of the MATCH clause for better performance.

Frequently Asked Questions

FalkorDB supports =, <>, <, <=, >, >=, plus string operators CONTAINS, STARTS WITH, ENDS WITH, and the list operator IN.
Yes. Use AND, OR, and NOT logical operators to combine predicates. Parentheses control evaluation precedence.
Inline filters use curly braces within node patterns, e.g. (n:Person {name: 'Alice'}). They are functionally equivalent to a WHERE clause equality check but offer more concise syntax.
Yes. When a WHERE clause filters on a property that has a range index, FalkorDB automatically uses an index scan instead of a full label scan. Use GRAPH.EXPLAIN to verify index usage.
Yes. Pattern predicates like WHERE (a)-[:KNOWS]->(b) or negated patterns WHERE NOT (a)-[:KNOWS]->(b) can be used directly in the WHERE clause.