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

Support SelectMany where subset comes from a single document

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 1.8.3
    • Component/s: Linq
    • Labels:
    • Environment:
    • Fully Compatible

      I would love to see this improvement make it into v2.0.

      Consider this basic class:

      class Book
      // ....
      public List<Ratings> Ratings

      {get; set;}


      And this query:

      var allGoodRatings =
      from b in mongo.Books
      from r in b.Ratings
      where r.Stars >= 4
      orderby r.Stars descending
      select r;

      AFAIK, this crashes with SelectMany not supported. It would be super easy to implement in the drive and as long as the second set is within each document it references, this could happen on the server and we don't have to resort to hacks where we double query it once on the db and then again on the client.

            Unassigned Unassigned
            mkennedy66996693 Michael Kennedy
            0 Vote for this issue
            1 Start watching this issue