[CSHARP-4061] LINQ3 AggregateFluent.ToString() will not render GroupStageDefinition Created: 16/Feb/22 Updated: 28/Oct/23 Resolved: 25/Feb/22 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | LINQ3 |
| Affects Version/s: | None |
| Fix Version/s: | 2.15.0 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Rich Collette | Assignee: | Robert Stam |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Epic Link: | CSHARP-3615 |
| Description |
SummaryEven with LINQ3 configured, and with a working aggregate that contains a Group method, when calling AggregateFluent.ToString() while debugging, I get an InvalidOperationException with the message "GroupExpressStageDefinitions can only be used with LINQ3" Please provide the version of the driver. If applicable, please provide the MongoDB server version and topology (standalone, replica set, or sharded cluster).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. Stack trace.
|
| Comments |
| Comment by Githook User [ 25/Feb/22 ] |
|
Author: {'name': 'rstam', 'email': 'robert@robertstam.org', 'username': 'rstam'}Message: |
| Comment by James Kovacs [ 16/Feb/22 ] |
|
Thank you for reporting this issue. This is a known limitation of Fluent Aggregate at the moment, but only affects the ToString() method, not the rendered MQL sent to the server. When ToString() is called on an AggregateFluent instance, we forward the ToString() call to the PipelineDefinition. At this point in the callstack we don't have easy access to which LINQ provider is configured for the MongoClient and assume that it is LINQ2 for backwards compatibility. We plan to fix this issue in an upcoming release. Please monitor this ticket for updates. |