删除neo4j 1.8中的所有节点和关系 [英] Delete all nodes and relationships in neo4j 1.8

查看:99
本文介绍了删除neo4j 1.8中的所有节点和关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这个问题已经被很多人问到了
为了我的研究,这是之前要问的一些问题

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

  1. 如何删除neo4j图中的所有关系?
  2. https://groups.google.com/forum/#!topic/neo4j/lgIaESPgUgE
  1. How to delete all relationships in neo4j graph?
  2. https://groups.google.com/forum/#!topic/neo4j/lgIaESPgUgE

但是毕竟还是不能解决我们的问题,
我们只想删除所有"节点和所有"关系

But after all, still can't solve our problems,
we just want to delete "ALL" nodes and "ALL" relationships

假设删除"ALL",可以看到还有 0个节点0个属性和0个关系

suppose delete "ALL" can see there are left 0 nodes 0 properties and 0 relationships

这是我执行论坛建议的删除"ALL"后拍摄的屏幕截图

This is the screenshot i took after executing the delete "ALL" suggested by forum

我的问题仍然相同,如何删除neo4j中的所有节点和所有关系

My question still the same, how do delete all nodes and all relationships in neo4j

推荐答案

从2.3.0版到3.3.0版

MATCH (n)
DETACH DELETE n

文档

2.3.0之前的版本

MATCH (n)
OPTIONAL MATCH (n)-[r]-()
DELETE n,r

文档

这篇关于删除neo4j 1.8中的所有节点和关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆