apoc.convert.toRelationshipListFunction
Syntax |
|
||
Description |
Converts the given value into a |
||
Arguments |
Name |
Type |
Description |
|
|
The value to convert into a relationship list. |
|
Returns |
|
||
Example
Given this dataset:
CREATE (:Person {name: 'Alice'})-[:KNOWS]->(:Person {name: 'Bob'})
CREATE (:Person {name: 'Charlie'})-[:KNOWS]->(:Person {name: 'Dave'})
The following query uses apoc.convert.toRelationshipList to cast a generic list to a LIST<RELATIONSHIP>:
MATCH ()-[r:KNOWS]->()
WITH collect(r) AS rels
RETURN apoc.convert.toRelationshipList(rels) AS relationships
| relationships |
|---|
[[:KNOWS], [:KNOWS]] |