[CSHARP-4057] LinqV3 Null Coalescing operator with empty string expression results in "Cannot find serializer for null" Created: 16/Feb/22 Updated: 28/Oct/23 Resolved: 29/Jun/22 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 2.17.0 |
| Type: | Bug | Priority: | Unknown |
| Reporter: | Rich Collette | Assignee: | Robert Stam |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Epic Link: | CSHARP-3615 | ||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Description |
SummaryWhen doing an aggregate containing a projection expression like:
This happens with string.Empty as well. Driver version 2.14.1 How to ReproduceSteps to reproduce. If possible, please include a Short, Self Contained, Correct (Compilable), Example. Additional BackgroundPlease provide any additional background information that may be helpful in diagnosing the bug. This seems to occur in ConstantExpressionToAggregationExpressionTranslator when making the call to get the serializer. |
| Comments |
| Comment by Robert Stam [ 29/Jun/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 Githook User [ 29/Jun/22 ] | |||||||||
|
Author: {'name': 'rstam', 'email': 'robert@robertstam.org', 'username': 'rstam'}Message: | |||||||||
| Comment by Richard Collette [ 01/Mar/22 ] | |||||||||
|
Your attempt to reproduce is not using aggregation and the bug appears to be specific to aggregation as indicated by the fact the error is occurring in a stack trace containing ConstantExpressionToAggregationExpressionTranslator. Unfortunately I probably will not be able to find the time to assemble a self contained example (which is difficult to do by the way since you need a collection to work with).
| |||||||||
| Comment by Boris Dogadov [ 16/Feb/22 ] | |||||||||
|
Hi richard.collette@precisely.com, Is it possible to provide a full self-contained sample that reproduces the problem?
2.14.1 driver, both LINQ2 and LINQ3 providers. Thanks. |