Reputation: 3929
I am generating nodes in a neo4j database and want to remove those that have no relationships. What is the best cypher instruction to do this?
Upvotes: 5
Views: 7309
Reputation: 19373
Try
MATCH (n) WHERE size((n)--())=0 DELETE (n)
Upvotes: 24