Delete all nodes and relationships in neo4j 1.8

后端 未结 7 1826
孤独总比滥情好
孤独总比滥情好 2021-01-30 05:10

I know this question is asked by many people already
for my research, here\'s some questions asked before

  1. How to delete all relationships in neo4j graph?
7条回答
  •  囚心锁ツ
    2021-01-30 05:36

    Neo4j cannot delete nodes that have a relation. You have to delete the relations before you can delete the nodes.

    But, it is simple way to delete "ALL" nodes and "ALL" relationships with a simple chyper. This is the code:

    MATCH (n) DETACH DELETE n

    --> DETACH DELETE will remove all of the nodes and relations by Match

提交回复
热议问题