Skip to content

OPTIONAL MATCH clause

Marijn van Wezel edited this page Oct 13, 2021 · 5 revisions

The OPTIONAL MATCH clause accepts a list of patterns to (optionally) match on.

Examples

$a = Query::node("a");
$b = Query::node("b");

$statement = Query::new()
	->optionalMatch([$a, $b])
	->build();

$this->assertSame("OPTIONAL MATCH (:a), (:b)", $statement);
Clone this wiki locally