apoc.coll.dropDuplicateNeighbors

Function APOC Core

apoc.coll.dropDuplicateNeighbors(list) - remove duplicate consecutive objects in a list

Signature

apoc.coll.dropDuplicateNeighbors(list :: LIST? OF ANY?) :: (LIST? OF ANY?)

Input parameters

Name Type Default

list

LIST? OF 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]