apoc.coll.set

Function APOC Core

apoc.coll.set(coll, index, value) | set index to value

Signature

apoc.coll.set(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 replaces the item at index 4 with the value 11:

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

[1, 3, 5, 7, 11]