Consider the following LINQ:
var dog1 = "dog"; var dog2 = "dog"; var query = coll.AsQueryable().Where(x => dog1 == dog2);
This will render the following MQL because we know client-side at runtime that the expression evaluates to true.
[ { $match : { $expr : true } }]
We should optimize this to the equivalent and faster:
[ { $match : { } }]
- related to
-
SERVER-65049 Optimize away { $expr : true } in $match clauses
- Closed