apoc.coll.zip

Function

apoc.coll.zip(list1 LIST<ANY>, list2 LIST<ANY>) - returns the two given LIST<ANY> values zipped together as a LIST<LIST<ANY>>.

Signature

apoc.coll.zip(list1 :: LIST<ANY>, list2 :: LIST<ANY>) :: LIST<ANY>

Input parameters

Name Type Default

list1

LIST<ANY>

null

list2

LIST<ANY>

null

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;
Table 1. Results
Output

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