The following LINQ query:
var obj = new[] { 1, 2, 3 }; var queryable = collection.AsQueryable() .Where(x => obj.Any(y => x.X== y));
is currently translated generically which results in MQL that is more complicated than necessary for this special case.
In this particular special case where the parameters to `Any` are a constant array and predicate comparing a field to the predicate parameter, the following simpler (and more efficient) MQL can be generated:
{ $match : { X : { $in : [1, 2, 3] } } }
- depends on
-
CSHARP-5448 Refactor AstFilterField and AstPipeline to remove reference to serializers
- Closed