BugZero found this defect 68 days ago.
Data sources
All data on this page is proprietary to BugZero® or gathered from public sources
3/12/2024
MongoDB Server
6.0.14
No fixed releases provided.
Null equality seems to evaluate always to true when comparing a field of a document inside an array. Concretely, Given this dataset of 3 elements [ { "xs": [ { "name": "a" } ] }, { "xs": [ { "name": null } ] }, { "xs": [ {} ] } ] When performing the query db.collection.find({ "xs.0.name": { $eq: null } }) we would expect to get the 2nd and 3rd result, but the actual result is that all documents are returned. The following returns the expected results: db.collection.find({ "$or": [ { "xs.0.name": { $exists: false } }, { "xs.0.name": { $type: "null" } } ] })
The description can be used as steps to reproduce.