apoc.coll.dropDuplicateNeighbors

Function

apoc.coll.dropDuplicateNeighbors(list LIST<ANY>) - removes duplicate consecutive objects in the LIST<ANY>.

Signature

apoc.coll.dropDuplicateNeighbors(list :: LIST<ANY>) :: LIST<ANY>

Input parameters

Name Type Default

list

LIST<ANY>

null

Usage examples

The following removes duplicate neighbors

RETURN apoc.coll.dropDuplicateNeighbors([1,1,1,4,5,4,6,6,7]) as output;
Table 1. Results
Output

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