1) List<PartyUser> users1 = userRepository.GetList(c => c.Roles.Any(r => r == UserRoles.Admin));
2) List<PartyUser> users2 = userRepository.GetList(c => c.Roles.Any(r => r == UserRoles.Admin || r == UserRoles.Editor));
First line returns 3 elements, but second line is 0, even it has wider filter and there a lot of documents with UserRoles.Editor.
public List<T> GetList(Expression<Func<T, bool>> where)
{ return Db.GetCollection<T>(CollectionName).Find(where).ToList(); }Where Db is IMongoDatabase
2.7.0 Beta1
- is duplicated by
-
CSHARP-2574 $elemMatch query contains gaps when It's generated based on LINQ Any and predicate contains `DocumentExpression` as operand.
- Closed
- related to
-
SERVER-93020 $elemMatch not working as expected with $or
- Needs Scheduling