db.{collection}.ensureIndex({ fieldA: 1, "nested.B": 1, "nested.C": 1 })
db.{collection}.find({ fieldA: "abc", "nested.B": "123", "nested.C": "456"})
Only uses first two index fields and then individually scans all matching items for "nested.C": 1
.
db.{collection}.find({ fieldA: "abc", "nested": { $elemMatch: { "B": "123", "C": "456" } })