BugZero found this defect 38 days ago.
Data sources
All data on this page is proprietary to BugZero® or gathered from public sources
4/11/2024
MongoDB Server
No affected releases provided.
8.0 Required
Sharded $lookup that uses expressive (let-pipeline) syntax can incorrectly match missing local fields to empty object foreign fields. For example, given query: [ { $lookup: { from: coll_foreign.getName(), as: "res", let: {local_a: "$a"}, pipeline: [{$match: {$expr: {$eq: ["$$local_a", "$a"]},}}, {$project: {_id: 1}}] } } ], and documents {_id: 1, b: 1}, {_id: 2, a: {}} within both the local and foreign collection, we would expect to see the following documents in the result set: {_id: 1, b: 1, res: [{_id: 1}]}, {_id: 2, a: {}, res: [{_id: 2}]} Instead, we can see {_id: 1, b: 1, res: [{_id: 2}]}, {_id: 2, a: {}, res: [{_id: 2}]} Worth looking into whether this serialization error affects non-$lookup cases like those described in SERVER-57403
Repro attached to linked BF as sharded_repro.js