apoc.refactor.setType
Syntax |
|
||
Description |
Changes the type of the given |
||
Input arguments |
Name |
Type |
Description |
|
|
The relationship to change the type of. |
|
|
|
The new type for the relationship. |
|
Return arguments |
Name |
Type |
Description |
|
|
The id of the given relationship. |
|
|
|
The id of the new relationship with the updated type. |
|
|
|
The message if an error occurred. |
Usage Examples
The examples in this section are based on the following graph:
CREATE (f:Foo)-[rel:FOOBAR]->(b:Bar);
The following changes the relationship type from FOOBAR
to NEW-TYPE
:
MATCH (f:Foo)-[rel:FOOBAR]->(b:Bar)
CALL apoc.refactor.setType(rel, 'NEW-TYPE')
YIELD input, output
RETURN input, output;
If we execute this query, it will result in the following output:
input | output |
---|---|
30 |
[:`NEW-TYPE`] |
And the graph now looks like this: