apoc.coll.dropDuplicateNeighbors

Details

Syntax

apoc.coll.dropDuplicateNeighbors(list)

Description

Removes duplicate consecutive objects in the LIST<ANY>.

Arguments

Name

Type

Description

list

LIST<ANY>

The list to remove duplicate consecutive values from.

Returns

LIST<ANY>

Usage examples

The following removes duplicate neighbors

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

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