apoc.coll.pairsMin

Function

apoc.coll.pairsMin(list LIST<ANY>) - returns LIST<ANY> values of adjacent elements in the LIST<ANY> ([1,2],[2,3]), skipping the final element.

Signature

apoc.coll.pairsMin(list :: LIST<ANY>) :: LIST<ANY>

Input parameters

Name Type Default

list

LIST<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]]