Created
August 8, 2019 22:06
-
-
Save joepindar/2b39495fac0a2a6826f2520943f90cf8 to your computer and use it in GitHub Desktop.
Neo4J CYPHER queries to find and delete orphan nodes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MATCH orphan nodes in Neo4J | |
MATCH (node) | |
WHERE NOT( (node)-[]-() ) | |
RETURN node | |
// DELETE orphan nodes in Neo4J | |
MATCH (node) | |
WHERE NOT( (node)-[]-() ) | |
DELETE node |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment