apoc.coll.indexOf

Details

Syntax

apoc.coll.indexOf(coll, value)

Description

Returns the index for the first occurrence of the specified value in the LIST<ANY>.

Arguments

Name

Type

Description

coll

LIST<ANY>

The list to find the given value in.

value

ANY

The value to find the first occurrence of in the given list.

Returns

INTEGER

Usage examples

The following returns the index of the value 3 in the list:

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

1