-
Notifications
You must be signed in to change notification settings - Fork 5
OPTIONAL MATCH clause
Marijn van Wezel edited this page Dec 13, 2022
·
5 revisions
The OPTIONAL MATCH
clause accepts a list of patterns to (optionally) match on. Refer to the MATCH
clause documentation for more information about the syntax of patterns.
Query::optionalMatch(CompletePattern|CompletePattern[] $patterns): Query
-
$patterns
: A single pattern to match, or a non-empty list of patterns to match.
-
addPattern(CompletePattern ...$pattern): self
: Add one or more patterns.
$movies = node("Movie");
$query = query()
->optionalMatch($movies)
->build();
$this->assertSame("OPTIONAL MATCH (:Movie)", $query);