Mass removal of Edges and Nodes - DELETE

Deleting of Nodes: 

To delete a node it should have no relationships

Delete all nodes and relationships

match (n)-[r]-() delete n, r


Delete all nodes which have no relationships

match (n) delete n


Delete only ExampleNodes which have no relationships

match (n:ExampleNode) delete n


Delete all relationships

match (n)-[r]-() delete r


Delete only ExampleRelation relationships

match (n)-[r:ExampleRelation]-() delete r


Comments

Popular posts from this blog

Property DataType - apoc.meta.type

Stopping and Starting the Neo4j Database

NULLS in Neo4j