neo4j Cypher Delete All Orphan Nodes


Example

Orphan nodes/vertices are those lacking all relationships/edges.

MATCH (n)
WHERE NOT (n)--()
DELETE n