- 
    Type:
Bug
 - 
    Resolution: Fixed
 - 
    Priority:
Major - P3
 - 
    Affects Version/s: None
 - 
    Component/s: None
 - 
    None
 
- 
        Fully Compatible
 - 
        ALL
 - 
        QO 2022-07-25, QO 2022-08-08, QO 2022-08-22
 - 
        None
 
- 
        None
 - 
        None
 - 
        None
 - 
        None
 - 
        None
 - 
        None
 
assert.commandWorked(coll.insert([
    {_id: 1, a: 1, b: 1},
]));
coll.createIndex({c: 1, _id: 1});
assert.eq(coll.find({c: null}, {c: 1}).toArray(), [{_id: 1}]);
This is specific to Bonsai and is not an issue with the classic optimizer. Since we cannot tell just from the index whether the field `c` is missing or null, this requires an extra fetch. However Bonsai appears to append c: null to the resulting document. The test that exercises this is here.