apoc.coll.pairWithOffset

Function APOC Core

apoc.coll.pairWithOffset(values, offset) - returns a list of pairs defined by the offset

Signature

apoc.coll.pairWithOffset(values :: LIST? OF ANY?, offset :: INTEGER?) :: (LIST? OF ANY?)

Input parameters

Name Type Default

values

LIST? OF ANY?

null

offset

INTEGER?

null

Usage Examples

The following returns a list of pairs defined by the offset:

RETURN apoc.coll.pairWithOffset([1,2,3,4], 2) AS value
Table 1. Results
value

[[1,3],[2,4],[3,null],[4,null]]

It works also as procedure:

CALL apoc.coll.pairWithOffset([1,2,3,4], 2)
Table 2. Results
value

[1,3]

[2,4]

[3,null]

[4,null]