apoc.coll.toSet

Details

Syntax

apoc.coll.toSet(coll)

Description

Returns a unique LIST<ANY> from the given LIST<ANY>.

Arguments

Name

Type

Description

coll

LIST<ANY>

The list of values to remove all duplicates from.

Returns

LIST<ANY>

Usage examples

The following converts a list to a set:

RETURN apoc.coll.toSet([1,1,2,1,3,4,1]) AS output;
Results
Output

[1, 2, 3, 4]