apoc.coll.pairsMin

Details

Syntax

apoc.coll.pairsMin(list)

Description

Returns LIST<ANY> values of adjacent elements in the LIST<ANY> ([1,2],[2,3]), skipping the final element.

Arguments

Name

Type

Description

list

LIST<ANY>

The list to create pairs from.

Returns

LIST<ANY>

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;
Results
Output

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