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

LINQ Feature Doesn't Support $elemMatch

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • 1.4.2
    • None

    Description

      Given a collection with embedded object arrays, I find no way to do an $elemMatch using LINQ.

      e.g. (quoted from Fluent mongo wiki):

      var people = collection.AsQueryable().Where(x => x.Addresses.Any(a => a.City == "Paris"));

      Should tranlate to {"Addresses": {$elemMatch:

      {"City": "Paris"}

      }}

      Attachments

        Activity

          People

            Unassigned Unassigned
            zaidmasud Zaid Masud
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: