Deleting graph elements — nodes and relationships, is done with DELETE
.
The examples start out with the following database:
To delete a node, use the DELETE
clause.
Query.
MATCH n WHERE n.name='Danny' DELETE n
Nothing is returned from this query, except the count of affected nodes.
If you are trying to delete a node with relationships on it, you have to delete these as well.
Query.
START n = node(3) MATCH n-[r]-() DELETE n, r
Nothing is returned from this query, except the count of affected nodes.
Copyright © 2013 Neo Technology