[CSHARP-556] SelectMany LINQ operator not supported Created: 07/Sep/12 Updated: 20/Jan/16 Resolved: 08/May/15 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Linq |
| Affects Version/s: | 1.6 |
| Fix Version/s: | 2.1 |
| Type: | New Feature | Priority: | Minor - P4 |
| Reporter: | Travis Krick | Assignee: | Craig Wilson |
| Resolution: | Done | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
windows 2k8 r2, using mongodb version 2.0.6 64-bit, using driver 1.6 |
||
| Issue Links: |
|
||||||||
| Epic Link: | Rewrite Linq | ||||||||
| Description |
|
Lets say i have this simplified version of my task workflow: public List<Task> Tasks { get; set; } } public class Task public string AssignedTo { get; set; } // other stuff elided In this case, the following query (where I'm trying to get all tasks assigned to me regardless of which workflow they are a part of): var db = DBUtils.GetMongoDB("taskpoc"); ... throws the following exception: This feature is to enable this to return those results. |
| Comments |
| Comment by Githook User [ 08/May/15 ] | |
|
Author: {u'username': u'craiggwilson', u'name': u'Craig Wilson', u'email': u'craiggwilson@gmail.com'}Message: | |
| Comment by Robert Stam [ 01/Nov/12 ] | |
|
Just to be clear, projection is already supported, just not in the most efficient way that is theoretically possible, since we always fetch the entire document and then do the projection. Projection does not require limiting the fields returned from the server, but rather limiting the fields is an optimization made possible by projection. We are definitely planning to use the projection to control which fields actually need to be returned from the server. See | |
| Comment by Travis Krick [ 01/Nov/12 ] | |
|
Understood. If hard to implement, projection can come in 2.0. but personally disagree with the downgrade to minor aspect. Not attempting to patronize, but with large docs, projection could limit the amount of data sent across the wire if a query returns many results. Projection [vertical slicing] is one of the main data operations, among filtering [horizontal slicing], sorting, and grouping. The main differentiating factor for c# is linq, so this driver supporting as much of that functionality as possible would be great. Thanks for the hard work, much appreciated. | |
| Comment by Craig Wilson [ 29/Oct/12 ] | |
|
SelectMany is actually a very difficult operator to support. We currently don't support Select either in the sense that it will still pull back the full document and run the projection client-side. Since there is another way to accomplish what you are doing by forming the query differently, I'm going to downgrade this to a minor feature and target it at 2.0
This will pull back all the TaskGraphs that have tasks assigned to you. Subsequently, you can filter out the tasks client-side. |