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

Add support for Enumerable.Any in LINQ queries

    • Type: Icon: New Feature New Feature
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.5
    • Affects Version/s: 1.4
    • Component/s: None
    • None

      Add support for LINQ queries like:

      var query1 = from c in collection.AsQueryable<C>()
                   where c.A.Any(a => (a % 2) == 0 && a > 2)
                   select c;
      

      This example assumes c.A is an array of ints and is looking for documents where c.A contains an even number greater than 2. It requires use of $elemMatch, but there is some concern about use of $elemMatch when the array values are not embedded documents.

      In any case, full support for mapping arbitrary C# predicates on array elements requires robust $elemMatch support in the server, including support for scalar or document values as well as $and and $or.

            Assignee:
            craig.wilson@mongodb.com Craig Wilson
            Reporter:
            robert@mongodb.com Robert Stam
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: