问题
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?
回答1:
Try
MATCH (n)
WHERE size((n)--())=0
DELETE (n)
来源:https://stackoverflow.com/questions/33559454/how-to-delete-all-nodes-that-do-not-have-any-relationships-neo4j-cypher