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

Add support for Enumerable.Any in LINQ queries

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major - P3
    • Resolution: Done
    • 1.4
    • 1.5
    • None
    • None

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: