apoc.coll.partition

Function APOC Core

apoc.coll.partition(list,batchSize)

Signature

apoc.coll.partition(values :: LIST? OF ANY?, batchSize :: INTEGER?) :: (LIST? OF ANY?)

Input parameters

Name Type Default

values

LIST? OF ANY?

null

batchSize

INTEGER?

null

Usage Examples

The following partitions a list into sublists of size 2:

CALL apoc.coll.partition([1,2,3,4,5], 2);
Table 1. Results
Value

[1, 2]

[3, 4]

[5]