[CSHARP-1772] Quering for first item of GroupBy aggregation produces NotSupportedException Created: 29/Sep/16 Updated: 04/Feb/22 Resolved: 04/Feb/22 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Linq, LINQ3 |
| Affects Version/s: | 2.3 |
| Fix Version/s: | 2.14.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Oleg Osovitskiy | Assignee: | James Kovacs |
| Resolution: | Done | Votes: | 2 |
| Labels: | rp-track, triaged | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Epic Link: | CSHARP-3615 | ||||||||
| Description |
|
I have entities with compound ids in my collection: {_id: {_id: guid, version: int}}. When I need to query for latest versions of objects with some guid identificators i use following LINQ query:
With 2.3 driver version it works when I make projection in the end. But when I need to extract whole object it fails with NotSupportedException:
I tried to workaround this with "fake" projection without success either:
Any suggestions? |
| Comments |
| Comment by James Kovacs [ 04/Feb/22 ] | ||||
|
This issue has been fixed in the new LINQ provider (known as LINQ3), which is included in the 2.14 release. Configure your MongoClientSettings to use LinqProvider.V3 if you want to use this functionality. To configure a client to use the LINQ3 provider use code like the following
| ||||
| Comment by Shiya Kohn [ 20/Feb/20 ] | ||||
|
Hi Craig
This has STILL (4 years later) not been implemented, despite many issues being opened about this. | ||||
| Comment by Craig Wilson [ 02/Nov/16 ] | ||||
|
Hi Oleg, Sorry for the late reply. I believe the issue is that you are attempting to select the entire root object, as opposed to part of it. We don't currently have support for this. I believe the fix would require us to use the $$ROOT variable to make this work. Craig |