$indexOfArray
The `$indexOfArray` operator searches an array for an occurrence of a specified value and returns the array index of the first occurrence. If the value is not found, returns -1.
Syntax
{ $indexOfArray: [ <array expression>, <search expression>, <start>, <end> ] }
Parameters
<array expression>
stringrequiredAn expression that resolves to an array.
<search expression>
stringrequiredAn expression that resolves to the value to search for.
<start>
numberOptional integer that specifies the starting index position for the search.
<end>
numberOptional integer that specifies the ending index position for the search.