NEO4J 批量删除关系
Neo4j batch delete relationship
neo4j删除所有节点和关系
neo4j清空所有数据命令如下:
MATCH (n)
OPTIONAL MATCH (n)-[r]-()
DELETE n,r
不好意思 你要加上限制一次只能删除10万条,不然就要配置调优
MATCH (n)
OPTIONAL MATCH (n)-[r]-()
WITH n,r limit 100000
DELETE n,r
neo4j删除两个节点之间的关系
match (n) delete n;
但节点太多就会报错 OutOfMemoryError
网上还有一些回答
MATCH(n) DETACH DELETE n;
MATCH (n)
OPTIONAL MATCH (n)-[r]-()
WITH n,r DELETE n,r;
在我的测试环境上不生效
https://stackoverrun.com/cn/q/8274593
您可以在较小的批次中删除它们。
批量删除节点 batch delete node
match(n:Node) with n limit 100000 DELETE n;
批量删除关系 batch delete relationship
match ()-[r:Type]-() with r limit 100000 DELETE r;
网友评论