-
Type:
Bug
-
Resolution: Duplicate
-
Priority:
Major - P3
-
None
-
Affects Version/s: 6.0.14
-
Component/s: None
-
None
-
ALL
-
-
None
-
None
-
None
-
None
-
None
-
None
-
None
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"
}
}
]
})
- duplicates
-
SERVER-27442 Positional path component in match language should not act as both an array index and a field name for a single document
-
- Backlog
-