How mongodb chooses the index while executing a query when multiple indexes exists
I have a MongoDB collection that stores some test submissions. The highlevel schema looks as follows. { "lessonType": "quiz", "userId": "639cb6d9513a420026eddca1" "courseId": "639cb6d9513a420026eddca2", "lessonId": "639cb6d9513a420026eddca3", ...some_more_fields } Now there are two indexes on this collection. first one: { courseId: 1,…