As you say in your edit, and coming from the part of explain you did not post is that isMulyiKey: true
along with other information on the cursor are showing that the index is being used. The indexBounds
are another indicator.
What is being described by indexOnly is the fact that your query contains another field, name
, which is not part of the index. When the query optimizer sees that all elements of the query can be met by using the fields from within the index this is referred to as a covered query and the indexOnly
property here is set to true.
So in an Ideal situation your query and results are using the information from the index only and MongoDB does not also have to look up the entry from the index in the collection in order to return more data.