apoc.coll.unionAll

apoc.coll.unionAll() is functionally equivalent to Cypher’s list concatenation.

Details

Syntax

apoc.coll.unionAll(list1, list2)

Description

Returns the full union of the two given LIST<ANY> values (duplicates included).

Arguments

Name

Type

Description

list1

LIST<ANY>

The list of values to compare against list2 and form a union from.

list2

LIST<ANY>

The list of values to compare against list1 and form a union from.

Returns

LIST<ANY>

Usage examples

The following examples create the full union of two lists using both APOC and Cypher:

apoc.coll.unionAll
RETURN apoc.coll.unionAll([1,2,3,4,5], [3,4,5,6,7]) AS output
Using Cypher’s list concatenation
RETURN [1,2,3,4,5] + [3,4,5,6,7] AS output
Results
Output

[1, 2, 3, 4, 5, 3, 4, 5, 6, 7]