apoc.nodes.delete

Procedure APOC Core

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

Signature

apoc.nodes.delete(nodes :: ANY?, batchSize :: INTEGER?) :: (value :: INTEGER?)

Input parameters

Name Type Default

nodes

ANY?

null

batchSize

INTEGER?

null

Output parameters

Name Type

value

INTEGER?

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;
Table 1. Results
id

3975

3976

3977

CALL apoc.nodes.delete([3975, 3976, 3977], 2);
Table 2. Results
value

3