You are looking at object equality in
versus field equality in
{ "grades.5.grade": "A" }
For 2 objects to be equals they need the same field with same values in the same order. In your case, the object grades.5 cannot be equal to the object {grade:A} because it has the extra fields date and score.