WHERE and Pattern Predicates

Filter pattern bindings — inline, in WHERE, or with EXISTS { }.

0/2 done

Where to put the filter

Three places to filter

  1. Inline in the pattern: (:Person {name:'Alice'}) — fastest, lets the planner hit an index immediately.
  2. WHERE clause: WHERE p.age > 30 — for expressions, ranges, list / string predicates.
  3. Pattern existence: WHERE EXISTS { (p)-[:OWNS]->(:Car) } — 'has at least one outgoing OWNS to a Car'.

Prefer inline for equality + indexed properties; reach for WHERE for ranges or boolean logic.

Reading in progress · 0 of 2 activities done