apoc.coll.different

Details

Syntax

apoc.coll.different(coll)

Description

Returns true if all the values in the given LIST<ANY> are unique.

Arguments

Name

Type

Description

coll

LIST<ANY>

The list to check for duplicates.

Returns

BOOLEAN

Usage examples

The following indicates whether all values in a collection are different:

RETURN apoc.coll.different([1,3,5,7,9]) AS output;
Results
Output

true

The following indicates that at least one value in the collection is a duplicate:

RETURN apoc.coll.different([1,1,5,7,9]) AS output;
Results
Output

false