[CSHARP-4592] LINQ3 projections unable to translate indexer access in IDictionary property Created: 31/Mar/23 Updated: 28/Oct/23 Resolved: 05/Apr/23 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | LINQ3 |
| Affects Version/s: | 2.19.1 |
| Fix Version/s: | 2.19.2 |
| Type: | Bug | Priority: | Unknown |
| Reporter: | Brandon N/A | Assignee: | Robert Stam |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Documentation Changes: | Not Needed |
| Documentation Changes Summary: | 1. What would you like to communicate to the user about this feature? |
| Description |
SummaryAfter updating to the latest version of the mongodb driver (2.19), which switched to the LINQ3 queryable provider, an existing query is throwing with the exception:
Please provide the version of the driver. If applicable, please provide the MongoDB server version and topology (standalone, replica set, or sharded cluster).MongoDBDriver 2.19.1, running against a local server version 6.0.5 How to ReproduceExample console app:
Additional BackgroundTried to do some investigation, from what I can tell, GetItemMethodToAggregationExpressionTranslator.Translate calls TryGetIDictionaryGenericInterface but there is no check that the `type` parameter itself is an `IDictionary` like `TryGetIEnumerableGenericInterface` does. |
| Comments |
| Comment by Githook User [ 18/May/23 ] |
|
Author: {'name': 'rstam', 'email': 'robert@robertstam.org', 'username': 'rstam'}Message: |
| Comment by Githook User [ 05/Apr/23 ] |
|
Author: {'name': 'rstam', 'email': 'robert@robertstam.org', 'username': 'rstam'}Message: |
| Comment by Brandon N/A [ 05/Apr/23 ] |
|
Thanks for the fix! |
| Comment by Robert Stam [ 03/Apr/23 ] |
|
Thanks for reporting this. Your diagnosis was spot on also. Thanks for making the extra effort! |