apoc.coll.indexOf

Function

apoc.coll.indexOf(coll LIST<ANY>, value ANY) - returns the index for the first occurrence of the specified value in the LIST<ANY>.

Signature

apoc.coll.indexOf(coll :: LIST<ANY>, value :: ANY) :: INTEGER

Input parameters

Name Type Default

coll

LIST<ANY>

null

value

ANY

null

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;
Table 1. Results
Output

1