However neither the answer is unambiguous nor it sounds like be a straight forward to implement for an arbitrary query. If it plays any role, I am on pymongo.
Thank you in advance for answers and ideas!
kind regards
Note that totalKeysExamined is 10, but totalDocsExamined is 0. Meaning that the server did not need to examine any documents, and can answer the query from index scan alone. A covered query will have totalDocsExamined: 0 with a non-zero totalKeysExamined in the explain output.
Additionally, if you’re using MongoDB 4.2, you should see a PROJECTION_COVERED stage: