MongoDB covered query needs to fetch and examine documents when exists operator is used
I see similar results when tried on MongoDB v4.2.8 - using the posted info.
In general, the $exists in a query filter uses the index on that field. For example, if there is a field fld1 and you run a query with a filter { fld1: {$exists: true}}, the query uses the index.
In the query plan output, the in-memory sort (&quot;stage&quot; : &quot;SORT&quot;) is because - for a compound index the filter must be an equality condition on the index prefix field (dataType) and then only the index will be used in a sort operation using the date field. The FETCH is for the SORT operation to happen in the memory (i.e., the index is not being used). So, the query is not covered.
For example, a query like this will use the index (and it will be covered):
db.test.find({ dataType: &quot;a&quot; }, { date: 1, _id: 0 }).sort({ date: -1 })

It is important to note that the query filter { dataType: &quot;a&quot; } uses an equality condition - and, {dataType: {$exists: true}} does not.
See Sort and Non-prefix Subset of an Index