apoc.coll.remove

Details

Syntax

apoc.coll.remove(coll, index [, length ])

Description

Removes a range of values from the LIST<ANY>, beginning at position index for the given length of values.

Arguments

Name

Type

Description

coll

LIST<ANY>

The list to remove values from.

index

INTEGER

The starting index in the list to begin removing values from.

length

INTEGER

The number of values to remove. The default is: 1.

Returns

LIST<ANY>

Usage examples

The following removes 2 values, starting from index 1:

RETURN apoc.coll.remove([1,3,5,7,9], 1, 2) AS output;
Results
Output

[1, 7, 9]