节点查询

表 1. 函数
限定名称 类型

apoc.nodes.isDense
apoc.nodes.isDense(node NODE) - 如果给定 NODE 是密集节点,则返回 true。

函数

apoc.nodes.connected
apoc.nodes.connected(startNode NODE, endNode NODE, types STRING) - 如果给定 NODE 直接连接到另一个给定 NODE,则返回 true。此函数针对密集节点进行了优化。

函数

apoc.node.relationship.exists
apoc.node.relationship.exists(node NODE, relTypes STRING) - 根据给定 NODE 是否具有连接 RELATIONSHIP(或者给定 NODE 是否具有给定类型和方向的连接 RELATIONSHIP)返回一个 BOOLEAN 值。

函数

apoc.node.relationships.exist
apoc.node.relationships.exist(node NODE, relTypes STRING) - 根据给定 NODE 是否具有连接 RELATIONSHIP 值(或者给定 NODE 是否具有给定类型和方向的连接 RELATIONSHIP 值)返回一个 BOOLEAN 值。

函数

apoc.nodes.relationships.exist
apoc.nodes.relationships.exist(nodes ANY, types STRING) - 根据给定 NODE 值是否具有给定 RELATIONSHIP 值返回一个 BOOLEAN 值。

函数

apoc.node.relationship.types
apoc.node.relationship.types(node NODE, relTypes STRING) - 返回给定 NODE 的不同 RELATIONSHIP 类型列表 LIST<STRING>

函数

apoc.nodes.relationship.types
apoc.nodes.relationship.types(nodes ANY, types STRING) - 返回给定 LIST<NODE> 值中的不同 RELATIONSHIP 类型列表 LIST<STRING>

函数

apoc.node.degree
apoc.node.degree(node NODE, relTypes STRING) - 返回给定 NODE 的总度数。

函数

apoc.node.id
apoc.node.id(node NODE) - 返回给定虚拟 NODE 的 ID。

函数

apoc.node.degree.in
apoc.node.degree.in(node NODE, relTypes STRING) - 返回连接到给定 NODE 的传入 RELATIONSHIP 值的总数。

函数

apoc.node.degree.out
apoc.node.degree.out(node NODE, relTypes STRING) - 返回从给定 NODE 出去的 RELATIONSHIP 值的总数。

函数

apoc.node.labels
apoc.node.labels(node NODE) - 返回给定虚拟 NODE 的标签。

函数

apoc.any.properties
apoc.any.properties(object ANY, keys LIST<STRING>) - 返回给定对象的所有属性。该对象可以是虚拟 NODE、真实 NODE、虚拟 RELATIONSHIP、真实 RELATIONSHIPMAP

函数

apoc.any.property
apoc.any.property(object ANY, key STRING) - 返回对象中给定键的属性。该对象可以是虚拟 NODE、真实 NODE、虚拟 RELATIONSHIP、真实 RELATIONSHIPMAP

函数

apoc.label.exists
apoc.label.exists(node ANY, label STRING) - 根据给定标签是否存在返回 true 或 false。

函数

关系方向模式语法

[<]RELATIONSHIP_TYPE1[>]|[<]RELATIONSHIP_TYPE2[>]|…​

示例:'FRIEND|MENTORS>|<REPORTS_TO' 将匹配到任意方向的 :FRIEND 关系、出站的 :MENTORS 关系和入站的 :REPORTS_TO 关系。

表 2. 存储过程
限定名称 类型

apoc.nodes.get
apoc.nodes.get(nodes ANY) - 返回具有给定 ID 的所有 NODE 值。

存储过程