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

Support SelectMany where subset comes from a single document

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Duplicate
    • Affects Version/s: 1.8.3
    • Fix Version/s: None
    • Component/s: Linq
    • Labels:
      None
    • Environment:
      .NET

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: