-
Notifications
You must be signed in to change notification settings - Fork 5
DELETE clause
wgevaert edited this page Apr 25, 2022
·
7 revisions
The DELETE
clause accepts a list of variables to be deleted
$tomVariable = Query::variable("tom");
$tomNode = $tomVariable->withProperty('name', Query::literal('tom'))->labeled("Person");
$statement = Query::new()
->match($tomNode)
->delete($tomVariable)
->build();
$this->assertSame("MATCH (tom:Person {name: 'tom'}) DELETE tom", $statement);
$tomVariable = Query::variable("tom");
$tomNode = $tomVariable->withProperty('name', Query::literal('tom'))->labeled("Person");
$statement = Query::new()
->match($tomNode)
->detachDelete($tomVariable)
->build();
$this->assertSame("MATCH (tom:Person {name: 'tom'}) DETACH DELETE tom", $statement);