15.8. Collapse node to relationship

CREATE (f:Foo)-[:FOO {a:1}]->(b:Bar {c:3})-[:BAR {b:2}]->(f) WITH id(b) as id
CALL apoc.refactor.collapseNode(id,'FOOBAR')
YIELD input, output RETURN *

Before we have this situation

apoc.refactor.collapseNode.dataset

And the result are

apoc.refactor.collapseNode

The property of the two relationship and the property of the node are joined in one relationship that has the properties a:1, b:2, name:Bar