apoc.nodes.get

Prior to the release of APOC 2025.07, this procedure was restricted on on-premise instances. To use it on an older version, it must be unrestricted. For more details, see Installation → Load and unrestrict.
Details

Syntax

apoc.nodes.get(nodes) :: (node)

Description

Returns all NODE values with the given ids.

Input arguments

Name

Type

Description

nodes

ANY

The nodes to be returned. Nodes can be of type STRING (elementId()), INTEGER (id()), NODE, or LIST<STRING | INTEGER | NODE>.

Return arguments

Name

Type

Description

node

NODE

A node.

Usage Examples

The examples in this section are based on the following graph:

CREATE (:Student {name: 'Alice', score: 71});
CREATE (:Student {name: 'Mark', score: 95});
CREATE (:Student {name: 'Andrea', score: 86});

We can return the internal IDs of these nodes using the id function:

MATCH (s:Student)
RETURN id(s) AS id;
Results
id

3975

3976

3977

apoc.nodes.get
CALL apoc.nodes.get([3975, 3976, 3977])
Using Cypher
MATCH (node)
WHERE id(n) IN [3975, 3976, 3977]
RETURN node
Results
node

(:Student {name: "Alice", score: 71})

(:Student {name: "Mark", score: 95})

(:Student {name: "Andrea", score: 86})