apoc.coll.insert

Function APOC Core

apoc.coll.insert(coll, index, value) | insert value at index

Signature

apoc.coll.insert(coll :: LIST? OF ANY?, index :: INTEGER?, value :: ANY?) :: (LIST? OF ANY?)

Input parameters

Name Type Default

coll

LIST? OF ANY?

null

index

INTEGER?

null

value

ANY?

null

Usage Examples

The following inserts the value 11 at index 3 in the list:

RETURN apoc.coll.insert([1,3,5,7,9], 3, 11) AS output;
Table 1. Results
Output

[1, 3, 5, 11, 7, 9]