[CSHARP-4116] Optimize { $expr : true } to { } Created: 29/Mar/22 Updated: 04/May/22 Resolved: 29/Mar/22 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | LINQ3 |
| Affects Version/s: | None |
| Fix Version/s: | 2.15.1 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | James Kovacs | Assignee: | Robert Stam |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Description |
|
Consider the following LINQ:
This will render the following MQL because we know client-side at runtime that the expression evaluates to true.
We should optimize this to the equivalent and faster:
|
| Comments |
| Comment by Githook User [ 04/May/22 ] | ||
|
Author: {'name': 'rstam', 'email': 'robert@robertstam.org', 'username': 'rstam'}Message: to { }. | ||
| Comment by Githook User [ 29/Mar/22 ] | ||
|
Author: {'name': 'rstam', 'email': 'robert@robertstam.org', 'username': 'rstam'}Message: to { }. | ||
| Comment by Robert Stam [ 29/Mar/22 ] | ||
|
Also optimize
to
|