Skip to content
Blog

Node/Rel Functions

Node/Rel functions are used to get information about nodes and relationships.

FunctionDescription
IDreturns the internal ID of node/rel
LABELreturns the label name of node/rel
OFFSETreturns the offset of the internal ID

See below for more details on each of these functions.

ID

Returns the internal ID of node/rel.

Input typeOutput type
NODEID (Internal database ID)
RELID (Internal database ID)
MATCH (a:User) RETURN ID(a) AS ID LIMIT 1;

Output:

-------
| ID |
-------
| 0:0 |
-------

LABEL

Returns the label name of node/rel.

Input typeOutput type
NODESTRING
RELSTRING
MATCH (a) RETURN LABEL(a) AS LABEL LIMIT 1;

Output:

---------
| LABEL |
---------
| User |
---------

OFFSET

Returns the offset of the internal ID.

Input typeOutput type
IDINT64
MATCH (a) RETURN OFFSET(ID(a)) AS OFFSET LIMIT 1;

Output:

----------
| OFFSET |
----------
| 0 |
----------