apoc.create.clonePathToVirtualProcedure
| This procedure returns virtual nodes and relationships that can only be accessed by other APOC procedures. For more information, see Virtual Nodes & Relationships (Graph Projections). |
Syntax |
|
||
Description |
Takes the given |
||
Input arguments |
Name |
Type |
Description |
|
|
The path to create a virtual path from. |
|
Return arguments |
Name |
Type |
Description |
|
|
The path result. |
|
Example
Given this dataset:
CREATE (:Person {name: 'Alice'})-[:KNOWS {since: 2020}]->(:Person {name: 'Bob'})
The following query matches a path and returns a virtual clone of it:
MATCH p = (:Person {name: 'Alice'})-[:KNOWS]->(:Person {name: 'Bob'})
CALL apoc.create.clonePathToVirtual(p) YIELD path
RETURN path AS virtualPath
| virtualPath |
|---|
(:Person {name: "Alice"})-[:KNOWS {since: 2020}]→(:Person {name: "Bob"}) |
The returned path is a virtual copy - any modifications made to its nodes or relationships do not affect the original graph data.