Search by condition with method Any (Linq) returns 0 documents when filter has OR condition

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 2.29.0
    • Affects Version/s: None
    • Component/s: LINQ, LINQ3
    • None
    • Fully Compatible
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      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

            Assignee:
            Robert Stam
            Reporter:
            Roman Buchyn
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: