apoc.coll.insertAll

Function

apoc.coll.insertAll(coll LIST<ANY>, index INTEGER, values LIST<ANY>) - inserts all of the values into the LIST<ANY>, starting at the specified index.

Signature

apoc.coll.insertAll(coll :: LIST<ANY>, index :: INTEGER, values :: LIST<ANY>) :: LIST<ANY>

Input parameters

Name Type Default

coll

LIST<ANY>

null

index

INTEGER

null

values

LIST<ANY>

null

Usage examples

The following inserts the values 11, 12, and 13 at index 3 in the list:

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

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