neo4j cypher:如何更改关系的类型 [英] neo4j cypher: how to change the type of a relationship

查看:907
本文介绍了neo4j cypher:如何更改关系的类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找不到在Cypher中更改关系类型的方法.完全可以执行此操作吗?如果没有:实现此结果的最佳方法是什么?

I can't find a way to change a relationship type in Cypher. Is this operation possible at all? If not: what's the best way achieve this result?

推荐答案

不幸的是,目前无法直接更改rel类型.

Unfortunately there is no direct change of rel-type possible at the moment.

您可以这样做:

MATCH (n:User {name:"foo"})-[r:REL]->(m:User {name:"bar"})
CREATE (n)-[r2:NEWREL]->(m)
// copy properties, if necessary
SET r2 = r
WITH r
DELETE r

这篇关于neo4j cypher:如何更改关系的类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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