MongoDB not using wildcard nested array index
When MongoDB indexes an array, or a field in an array of subdocuments, the index is essentially a list of value -&gt; recordId pairs.
The value part is the actual field value, and does not include any information about the index of the value within the array.
The query executor's index scan matches the queried value with the indexed values and returns a list of recordIds that then need to be fetched.
If you have additional requirements, such as an elemMatch clause or require the value to be in a specific position in the array, the documents will have to be examined after the index scan.
This means that if you are using an index on {&quot;quizzes.done&quot;:1} to match &quot;quizzes.0.done&quot;: true, the executory would need to retrieve all documents that contain at least 1 quiz that is done, and examine each to determine if it is the first index.  In that case, a collection scan is quite likely more efficient.
You noted that the index on {&quot;quizzes.0.done&quot;:1} works for that query, but that is because the query executor can guarantee the location of the match within the array with that index, and be certain that no other array element will match.
I'm not certain how the { quizzes.[$**].done: 1 } index might be handled, but I suspect it won't look much different than { quizzes.done: 1 }