apoc.coll.pairsMin

Function APOC Core

apoc.coll.pairsMin([1,2,3]) returns [1,2],[2,3]

Signature

apoc.coll.pairsMin(list :: LIST? OF ANY?) :: (LIST? OF ANY?)

Input parameters

Name Type Default

list

LIST? OF ANY?

null

Usage Examples

The following creates a list of lists of adjacent elements in a list, skipping the last item:

RETURN apoc.coll.pairsMin([1,2,3,4,5]) AS output;
Table 1. Results
Output

[[1, 2], [2, 3], [3, 4], [4, 5]]