apoc.create.virtualPathProcedure
Syntax |
|
||
Description |
Returns a virtual |
||
Input arguments |
Name |
Type |
Description |
|
|
The labels to assign to the new virtual start node. |
|
|
|
The properties to assign to the new virtual start node. |
|
|
|
The type to assign to the new virtual relationship. |
|
|
|
The properties to assign to the new virtual relationship. |
|
|
|
The labels to assign to the new virtual node. |
|
|
|
The properties to assign to the new virtual node. |
|
Return arguments |
Name |
Type |
Description |
|
|
The created virtual start node. |
|
|
|
The created virtual relationship. |
|
|
|
The created virtual end node. |
|
Example
This function creates virtual nodes and relationships entirely in memory; no pre-existing graph data is required.
The following query creates a virtual path between two new virtual nodes connected by a virtual relationship:
CALL
apoc.create.virtualPath(
['Person'],
{name: 'Alice'},
'KNOWS',
{since: 2020},
['Person'],
{name: 'Bob'}
)
YIELD from, rel, to
RETURN from, rel, to
| from | rel | to |
|---|---|---|
(:Person {name: "Alice"}) |
[:KNOWS {since: 2020}] |
(:Person {name: "Bob"}) |
Nothing is written to the graph - the returned nodes and relationship exist only for the duration of the query.