[CSHARP-3293] Linq Where method is ignored inside Collection.AsQueryable().GroupBy() of MongoDB.Driver 2.11.2 Created: 20/Dec/20 Updated: 28/Oct/23 Resolved: 16/Feb/22 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Linq |
| Affects Version/s: | 2.11.2 |
| Fix Version/s: | 2.14.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | God God | Assignee: | Unassigned |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
C# .Net |
||
| Issue Links: |
|
||||||||
| Epic Link: | CSHARP-3615 | ||||||||
| Description |
|
Im writing some service in C# and I have to use MongoDB.Driver 2.11.2. I have some issue when grouping my list of items. It looks like a bug. This is my code:
I got different results from next lines.
It looks like "Where" method of "first line" got ignored and calculation performed on wrong values. And also the result of the "first line" does not changes if i change a condition. I did not find any information on MongoDB official site.
Why "Where" method got ignored and i have different results? Is there any solution? Tnx in advance. |
| Comments |
| Comment by James Kovacs [ 16/Feb/22 ] | ||||||||||||||||||||||||||||||||||||||||
|
This issue has been fixed in the new LINQ provider (known as LINQ3), which is included in the 2.14 release. Unfortunately it revealed an issue around our handling of nullable types in GroupBy. I have filed The following code using bool instead of bool? works as expected:
The resulting MQL correctly filters the grouped items:
I have closed this issue as resolved. Please follow Sincerely, | ||||||||||||||||||||||||||||||||||||||||
| Comment by God God [ 07/Mar/21 ] | ||||||||||||||||||||||||||||||||||||||||
|
Hi, is there is any progress with this bug? Tnx | ||||||||||||||||||||||||||||||||||||||||
| Comment by Boris Dogadov [ 24/Dec/20 ] | ||||||||||||||||||||||||||||||||||||||||
|
Hi denis@r2net.com ! | ||||||||||||||||||||||||||||||||||||||||
| Comment by God God [ 20/Dec/20 ] | ||||||||||||||||||||||||||||||||||||||||
|
typo in bulleted "first line". Should be:
|