apoc.convert.toSet

This function is deprecated. Use Cypher’s coll.distinct() function instead.

Details

Syntax

apoc.convert.toSet(list)

Description

Converts the given value into a set represented in Cypher as a LIST<ANY>.

Arguments

Name

Type

Description

list

ANY

The list to convert into a set.

Returns

LIST<ANY>

Usage examples

The following converts a list to a set using both APOC and Cypher.

apoc.convert.toSet
RETURN apoc.convert.toSet([1,2,3,2]) AS output;
Using Cypher’s coll.distinct
RETURN coll.distinct([1,2,3,2]) AS output;
Results
Output

[1, 2, 3]