apoc.coll.different

Function

apoc.coll.different(coll LIST<ANY>) - returns true if all the values in the given LIST<ANY> are unique.

Signature

apoc.coll.different(values :: LIST<ANY>) :: BOOLEAN

Input parameters

Name Type Default

values

LIST<ANY>

null

Usage examples

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

RETURN apoc.coll.different([1,3,5,7,9]) AS output;
Table 1. 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;
Table 2. Results
Output

false