apoc.coll.zip

Details

Syntax

apoc.coll.zip(list1, list2)

Description

Returns the two given LIST<ANY> values zipped together as a LIST<LIST<ANY>>.

Arguments

Name

Type

Description

list1

LIST<ANY>

The list to zip together with list2.

list2

LIST<ANY>

The list to zip together with list1.

Returns

LIST<ANY>

Usage examples

The following combines two lists, element for element, into a list of lists:

RETURN apoc.coll.zip([1,2,3], ["a", "b", "c"]) as output;
Results
Output

[[1, "a"], [2, "b"], [3, "c"]]