-
Type:
Bug
-
Resolution: Duplicate
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Optimization
-
ALL
-
None
-
None
-
None
-
None
-
None
-
None
-
None
9.0 and 8.0 disagree on the result set without the inhibit.
db.local.drop();
db.foreign.drop();
db.local.insertOne({_id: 1, array: [0], a: 0});
db.foreign.insertOne({a: 0});
const norMatch = {
$nor: [
{m: {$elemMatch: {a: {$ne: 1}}}, array: {$not: {$elemMatch: {$nin: []}}}},
{m: {$not: {$not: {$nin: []}}}, a: 1},
],
};
const lookupStage = {
$lookup: {from: db.foreign.getName(), localField: "a", foreignField: "a", as: "m"},
};
db.local.aggregate([
lookupStage,
{$match: norMatch},
]);
db.local.aggregate([
lookupStage,
{$_internalInhibitOptimization: {}},
{$match: norMatch},
]);
- is related to
-
SERVER-98935 $elemMatch with nested $all is not reparseable
-
- In Code Review
-
-
SERVER-101007 $or followed by always false $elemMatch can fail pipeline optimization
-
- Closed
-