apoc.coll.indexOf

Function

apoc.coll.indexOf(coll [Any], value Any) - returns the index for the first occurrence of the specified value in the list.

Signature

apoc.coll.indexOf(coll :: LIST? OF ANY?, value :: ANY?) :: (INTEGER?)

Input parameters

Name Type Default

coll

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