apoc.coll.zipToRows

Details

Syntax

apoc.coll.zipToRows(list1, list2) :: (value)

Description

Returns the two LIST<ANY> values zipped together, with one row per zipped pair.

Input arguments

Name

Type

Description

list1

LIST<ANY>

The list to zip together with list2.

list2

LIST<ANY>

The list to zip together with list1.

Return arguments

Name

Type

Description

value

LIST<ANY>

A zipped pair.

Usage examples

The following examples demonstrate how to zip two lists together in APOC and Cypher:

apoc.coll.zipToRows
WITH [1, 2, 3] AS list1, ["a", "b", "c"] AS list2
CALL apoc.coll.zipToRows(list1, list2)
YIELD value
RETURN value
Cypher’s UNWIND
WITH [1, 2, 3] AS list1, ["a", "b", "c"] AS list2
UNWIND range(0, size(list1) - 1) AS i
RETURN [list1[i], list2[i]]
Results
value

[1, "a"]

[2, "b"]

[3, "c"]