如何删除neo4j图中的所有关系? [英] How to delete all relationships in neo4j graph?

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

问题描述

我需要删除所有节点之间的所有关系。有没有办法删除neo4j图中的所有关系?请注意,我使用的是ruby绑定 - neography gem。
在gem的wiki中没有关于它的信息。我也试图在neo4j文档中找到一种方法,但没有任何结果。

I need to delete all relationships between all nodes. Is there any way to delete all relationships in the neo4j graph? Note that I am using ruby bindings - the neography gem. There is no info about that in the wiki of the gem. I've also tried to find a way to do it in the neo4j documentation without any result.

Neo4j版本是1.7.2。

Neo4j version is 1.7.2.

推荐答案

删除所有关系:

start r=relationship(*) delete r;

创建所有节点之间的所有关系,我假设:

creating all relationships between all nodes, i'd assume:

start n=node(*),m=node(*) create unique n-[r:RELTYPE]-m;

但你宁愿不要有太多的顶点,因为它会在低内存上崩溃(至少在我的情况我有1mil顶点和1gb ram)

but you rather dont want to have too many vertices, since it collapse on low memory (at least in my case i got 1mil vertices and 1gb ram)

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

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