apoc.node.labels
语法 |
|
||
描述 |
返回给定虚拟 |
||
参数 |
名称 |
类型 |
描述 |
|
|
要返回标签的节点。 |
|
返回 |
|
||
使用示例
本节中的示例基于以下图
CREATE (s:Student {name: 'Alice', score: 71});
CREATE (s:Student {name: 'Mark', score: 95});
CREATE (s:Student {name: 'Andrea', score: 86});
CREATE (s:Student {name: 'Rajesh', score: 89});
CREATE (s:Student {name: 'Jennifer', score: 96});
CREATE (s:Student {name: 'Katarina', score: 80});
如果我们创建包含学生分数的虚拟节点,我们可以使用 apoc.node.labels 来返回这些虚拟节点的标签
MATCH (s:Student)
CALL apoc.create.vNode(['Score'],{value: s.score})
YIELD node
RETURN node, apoc.node.labels(node) AS labels;
| node | labels |
|---|---|
(:Score {value: 71}) |
["Score"] |
(:Score {value: 95}) |
["Score"] |
(:Score {value: 86}) |
["Score"] |
(:Score {value: 89}) |
["Score"] |
(:Score {value: 96}) |
["Score"] |
(:Score {value: 80}) |
["Score"] |