Description
Since MongoDB doesn't support predicates inside the $first and $last operators, we should throw a not supported exception.
|
|
var list = await collection.Aggregate()
|
.Group(x => x.Name, g => new { Key = g.Key, FavoritePet = g.Pets.First(x => x.Name == "Fluffy") })
|
.ToListAsync();
|
|
Currently, I believe the predicates are getting dropped when we rewrite First/Last calls