Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-2006

Query Lambdas: "!externalList.Contains(prop)" supported, but "externalList.Contains(prop) == false" fails

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 2.14.0
    • Affects Version/s: 2.4.3
    • Component/s: Linq, LINQ3

      Hey chaps
      I logged a VERY similar issue some time back (which has been resolved: CSHARP-1543 )
      This is specific to using the .Contains() linq extension on (in my case) a generic List, checking if it contains a property of the queried document.
      Pseudo example:

      var myList = new List<string>() { "bob", "frank" };
      var results = queryable.Where(doc => myList.Contains(doc.prop) == false).ToList(); //this fails
      var results2 = queryable.Where(doc => !myList.Contains(doc.prop)).ToList(); //this works
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            kevinza Kevin Versfeld
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: