[CSHARP-4665] ExpressionNotSupportedException for string.IsNullOrWhitespace after upgrade Created: 02/Jun/23 Updated: 28/Jun/23 Resolved: 28/Jun/23 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 2.21.0 |
| Type: | New Feature | Priority: | Unknown |
| Reporter: | John Staveley | Assignee: | Robert Stam |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Documentation Changes: | Not Needed | ||||||||
| Documentation Changes Summary: | 1. What would you like to communicate to the user about this feature? |
||||||||
| Description |
SummaryI am running MongoDb 6.0.6 When upgrading from Mongodbdriver 2.18 to 2.19.2 several queries I run begin to fail with the ExpressionNotSupportedException.How to Reproduce It appears to be similar to this issue: |
| Comments |
| Comment by Githook User [ 28/Jun/23 ] |
|
Author: {'name': 'rstam', 'email': 'robert@robertstam.org', 'username': 'rstam'}Message: |
| Comment by Robert Stam [ 21/Jun/23 ] |
|
|
| Comment by Robert Stam [ 06/Jun/23 ] |
|
I've added support in LINQ3 for IsNullOrWhiteSpace. Note that in the case of a Find projection, this only worked in LINQ2 because LINQ2 would sometimes execute things it couldn't translate to MQL client-side. In this case LINQ2 would fetch the values from the server and compute the IsNullOrWhiteSpace result client-side. Other than that, LINQ2 had no support for IsNullOrWhiteSpace. LINQ3 never executes anything client-side. This is a deliberate design decision that we made. With this fix, when using LINQ3 these types of projections will now work as long as you are using version 4.4 or newer of the server (that was the version that added support for $project style projections with expressions for find). |
| Comment by PM Bot [ 02/Jun/23 ] |
|
Hi john.staveley@myglobalbridge.com, thank you for reporting this issue! The team will look into it and get back to you soon. |