How to delete all nodes that do not have any relat

2019-04-02 00:24发布

问题:

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)


标签: neo4j cypher