[CSHARP-912] Support SelectMany where subset comes from a single document Created: 19/Feb/14  Updated: 27/Apr/15  Resolved: 24/Apr/15

Status: Closed
Project: C# Driver
Component/s: Linq
Affects Version/s: 1.8.3
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Michael Kennedy Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

.NET


Issue Links:
Duplicate
duplicates CSHARP-556 SelectMany LINQ operator not supported Closed
Related
is related to CSHARP-456 Support linq projections to only pull... Closed
Epic Link: Rewrite Linq
Backwards Compatibility: Fully Compatible

 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.



 Comments   
Comment by Craig Wilson [ 24/Apr/15 ]

Closing this as a duplicate of CSHARP-556.

Generated at Wed Feb 07 21:38:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.