apoc.coll.union

Details

Syntax

apoc.coll.union(list1, list2)

Description

Returns the distinct union of the two given LIST<ANY> values.

Arguments

Name

Type

Description

list1

LIST<ANY>

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

list2

LIST<ANY>

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

Returns

LIST<ANY>

Usage examples

The following creates a distinct union of two lists:

RETURN apoc.coll.union([1,2,3,4,5], [3,4,5,6,7]) AS output;
Results
Output

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