MERGE instead of CREATE for apoc.create.relationship()

百般思念 提交于 2021-01-27 20:12:09

问题


The procedure apoc.create.relationship(n1,RelType,{},n2) behaves accordingly to the CREATE statement. If a relationship of type RelType already exists between nodes n1 and n2 apoc.create.relationship() will create a duplicate.

Is there an equivalent version of apoc.create.relationship() that behaves like MERGE?


回答1:


There is a procedure

apoc.merge.relationship()

which takes same parameters as apoc.create.relationship() and should do what you need.

It has been mentioned in this blog post, but it seems to be missing from documentation - see this issue.



来源:https://stackoverflow.com/questions/52273703/merge-instead-of-create-for-apoc-create-relationship

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!