Graph Element Functions

Node Functions

node.degree()

Get the total degree (in + out) of a node.

Syntax: node.degree(node, [relType])

Returns: Long - Total degree

APOC Compatible: apoc.node.degree


node.degree.in()

Get the incoming degree of a node.

Syntax: node.degree.in(node, [relType])

Returns: Long - Incoming degree

APOC Compatible: apoc.node.degree.in


node.degree.out()

Get the outgoing degree of a node.

Syntax: node.degree.out(node, [relType])

Returns: Long - Outgoing degree

APOC Compatible: apoc.node.degree.out


node.id()

Get the internal ID of a node.

Syntax: node.id(node)

Returns: String - Node ID (RID)

APOC Compatible: apoc.node.id


node.labels()

Get all labels of a node.

Syntax: node.labels(node)

Returns: List - List of labels

APOC Compatible: apoc.node.labels


node.relationship.exists()

Check if a relationship exists from a node.

Syntax: node.relationship.exists(node, [relType], [direction])

Returns: Boolean - true if relationship exists

APOC Compatible: apoc.node.relationship.exists


node.relationship.types()

Get all relationship types connected to a node.

Syntax: node.relationship.types(node, [direction])

Returns: List - List of relationship types

APOC Compatible: apoc.node.relationship.types


Relationship Functions

rel.endNode()

Get the end node of a relationship.

Syntax: rel.endNode(relationship)

Returns: Node - End node

APOC Compatible: apoc.rel.endNode


rel.id()

Get the internal ID of a relationship.

Syntax: rel.id(relationship)

Returns: String - Relationship ID (RID)

APOC Compatible: apoc.rel.id


rel.startNode()

Get the start node of a relationship.

Syntax: rel.startNode(relationship)

Returns: Node - Start node

APOC Compatible: apoc.rel.startNode


rel.type()

Get the type of a relationship.

Syntax: rel.type(relationship)

Returns: String - Relationship type

APOC Compatible: apoc.rel.type