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

LINQ .Any(x => !list.Contains(x)) translates incorrectly.

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.8.0
    • Affects Version/s: 2.0.1
    • Component/s: Linq
    • None

      I have a document with two arrays, one is a collection of string tags and the other is a collection of sub documents. I have created a mongo update that removes a sub document if any of the tags for the documents array are not in the provided list. When I execute the update I'm getting an IndexOutOfRangeException.

      I've created a sample project to reproduce the bug which can be found here.
      https://github.com/nickmkk/UpdateWhereItemsArentInProvidedList

      Run the tests in RemoveSubEntityServiceTests.cs to reproduce the issue.

      Note that the problem seems to be with the filter in RemoveSubEntityService.cs on line 25

            Assignee:
            dmitry.lukyanov@mongodb.com Dmitry Lukyanov (Inactive)
            Reporter:
            nickmkk Nicholas Markkula
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: