apoc.coll.zip

Function

apoc.coll.zip(list1 [Any], list2 [Any]) - returns the two given lists zipped together as a list of lists.

Signature

apoc.coll.zip(list1 :: LIST? OF ANY?, list2 :: LIST? OF ANY?) :: (LIST? OF ANY?)

Input parameters

Name Type Default

list1

LIST? OF ANY?

null

list2

LIST? OF 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"]]