Deleting All Nodes and Relationships
Seems that I am doing this a lot: deleting my entire graph (all nodes and relationships) and rebuilding from scratch. I guess that this is part of the learning process.
Route 1: Delete Relationships then Nodes
A relationship is constrained to join a start node to an end node. Every relationship must be associated with at least one node (a relationship may begin and end on the same node). No such constraint exists for nodes. As a result relationships must be deleted before nodes are deleted.
Delete all relationships using either
Then delete the nodes with
Route 2: Detach and Delete
DETACH DELETE it’s possible to delete relationships and nodes at once.
Confirm that all nodes and relationships have gone.