Node Querying

Table 1. Functions
Qualified Name Type

apoc.nodes.isDense

apoc.nodes.isDense(node) - returns true if it is a dense node

Function

apoc.nodes.connected

apoc.nodes.connected(start, end, rel-direction-pattern) - returns true when the node is connected to the other node, optimized for dense nodes

Function

apoc.node.relationship.exists

apoc.node.relationship.exists(node, rel-direction-pattern) - returns true when the node has the relationships of the pattern

Function

apoc.node.relationships.exist

apoc.node.relationships.exist(node, rel-direction-pattern) - returns a map with rel-pattern, boolean for the given relationship patterns

Function

apoc.nodes.relationships.exist

apoc.nodes.relationships.exist(node|nodes|id|[ids], rel-direction-pattern) - returns a list of maps where each one has two fields: node which is the node subject of the analysis and exists which is a map with rel-pattern, boolean for the given relationship patterns

Function

apoc.node.relationship.types

apoc.node.relationship.types(node NODE, relTypes STRING) - returns a LIST<STRING> of distinct RELATIONSHIP types for the given NODE.

Function

apoc.nodes.relationship.types

apoc.nodes.relationship.types(nodes ANY, types STRING) - returns a LIST<STRING> of distinct RELATIONSHIP types from the given LIST<NODE> values.

Function

apoc.node.degree

apoc.node.degree(node NODE, relTypes STRING) - returns the total degrees of the given NODE.

Function

apoc.node.id

returns id for (virtual) nodes

Function

apoc.node.degree.in

apoc.node.degree.in(node, relationshipName) - returns total number number of incoming relationships

Function

apoc.node.degree.out

apoc.node.degree.out(node, relationshipName) - returns total number number of outgoing relationships

Function

apoc.node.labels

returns labels for (virtual) nodes

Function

apoc.any.properties

returns properties for virtual and real, nodes, rels and maps

Function

apoc.any.property

returns property for virtual and real, nodes, rels and maps

Function

apoc.label.exists

apoc.label.exists(element, label) - returns true or false related to label existance

Function

Rel-direction-pattern Syntax:

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

Example: 'FRIEND|MENTORS>|<REPORTS_TO' will match to :FRIEND relationships in either direction, outgoing :MENTORS relationships, and incoming :REPORTS_TO relationships.

Table 2. Procedures
Qualified Name Type

apoc.nodes.get

apoc.nodes.get(node|nodes|id|[ids]) - quickly returns all nodes with these ids

Procedure