[CSHARP-1719] Selecting from a IMongoQueryable collection with a Linq Expression throws an error because of 'Id' property Created: 21/Jul/16 Updated: 09/Nov/22 Resolved: 09/Nov/22 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Linq, Serialization |
| Affects Version/s: | 2.2.4 |
| Fix Version/s: | 2.3 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Florent BROUCA | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows 7 64bits |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Description |
|
Using the mongoDb c# driver 2.2.4, selecting from a IMongoQueryable collection with a Linq Expression throws an error because of my Id field. The exception thrown is 'Element 'Id' does not match any field or property of class MongoDbHierarchicalStoring.Man.' You can find more info on the stackoverflow post: http://stackoverflow.com/questions/38508622/selecting-from-a-imongoqueryable-collection-with-a-linq-expression-throws-an-err If I change my 'Id' property and rename it '_id', it worked. But in a prior version of the driver (2.1.1) it used to work fine. |
| Comments |
| Comment by James Kovacs [ 09/Nov/22 ] |
|
Works in both LINQ2 and LINQ3 with the latest driver. |
| Comment by Jeffrey Yemin [ 28/Oct/17 ] |
|
Ping rstam |
| Comment by Robert Stam [ 20/Dec/16 ] |
|
I can reproduce this against 2.4.0 with the code you provided. It's not so much a regression as a new scenario that the original fix didn't contemplate. The original fix was for LINQ expressions. Your sample code is using the fluent aggregate API. |
| Comment by James Kovacs [ 07/Oct/16 ] |
|
There appears to be a regression. In C# Driver 2.4.0-beta1, the attached code, |
| Comment by Githook User [ 10/Aug/16 ] |
|
Author: {u'username': u'craiggwilson', u'name': u'Craig Wilson', u'email': u'craiggwilson@gmail.com'}Message: |
| Comment by Githook User [ 10/Aug/16 ] |
|
Author: {u'username': u'craiggwilson', u'name': u'Craig Wilson', u'email': u'craiggwilson@gmail.com'}Message: |