Node Querying

Table 1. Functions
Qualified Name Type

apoc.nodes.isDense
apoc.nodes.isDense(node NODE) - returns true if the given NODE is a dense node.

Function

apoc.nodes.connected
apoc.nodes.connected(startNode NODE, endNode NODE, types STRING) - returns true when a given NODE is directly connected to another given NODE. This function is optimized for dense nodes.

Function

apoc.node.relationship.exists
apoc.node.relationship.exists(node NODE, relTypes STRING) - returns a BOOLEAN based on whether the given NODE has a connecting RELATIONSHIP (or whether the given NODE has a connecting RELATIONSHIP of the given type and direction).

Function

apoc.node.relationships.exist
apoc.node.relationships.exist(node NODE, relTypes STRING) - returns a BOOLEAN based on whether the given NODE has connecting RELATIONSHIP values (or whether the given NODE has connecting RELATIONSHIP values of the given type and direction).

Function

apoc.nodes.relationships.exist
apoc.nodes.relationships.exist(nodes ANY, types STRING) - returns a BOOLEAN based on whether or not the given NODE values have the given RELATIONSHIP values.

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
apoc.node.id(node NODE) - returns the id for the given virtual NODE.

Function

apoc.node.degree.in
apoc.node.degree.in(node NODE, relTypes STRING) - returns the total number of incoming RELATIONSHIP values connected to the given NODE.

Function

apoc.node.degree.out
apoc.node.degree.out(node NODE, relTypes STRING) - returns the total number of outgoing RELATIONSHIP values from the given NODE.

Function

apoc.node.labels
apoc.node.labels(node NODE) - returns the labels for the given virtual NODE.

Function

apoc.any.properties
apoc.any.properties(object ANY, keys LIST<STRING>) - returns all properties of the given object. The object can be a virtual NODE, a real NODE, a virtual RELATIONSHIP, a real RELATIONSHIP, or a MAP.

Function

apoc.any.property
apoc.any.property(object ANY, key STRING) - returns the property for the given key from an object. The object can be a virtual NODE, a real NODE, a virtual RELATIONSHIP, a real RELATIONSHIP, or a MAP.

Function

apoc.label.exists
apoc.label.exists(node ANY, label STRING) - returns true or false depending on whether or not the given label exists.

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(nodes ANY) - returns all NODE values with the given ids.

Procedure