[CSHARP-3865] ToUpperInvariant Not Supported Created: 17/Sep/21 Updated: 28/Oct/23 Resolved: 07/Oct/21 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Linq |
| Affects Version/s: | None |
| Fix Version/s: | 2.14.0 |
| Type: | Bug | Priority: | Unknown |
| Reporter: | Richard Collette | Assignee: | Robert Stam |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Epic Link: | CSHARP-3615 | ||||||||
| Description |
|
The documentation states that ToUpperInvariant is supported but I am getting an error when using it.
|
| Comments |
| Comment by Robert Stam [ 01/Apr/22 ] | ||||||||
|
We now think it was a mistake to implement this. The implementation treats ToLowerInvariant and ToUpperInvariant as synonyms for ToLower and ToUpper, but that's not actually correct. The server has no support for doing culture-invariant to upper or lower case transformations, so it's a mistake to claim to support these methods. | ||||||||
| Comment by Robert Stam [ 07/Oct/21 ] | ||||||||
|
This issue has been fixed in the new LINQ provider (known as LINQ3) which will be included in the upcoming 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 Richard Collette [ 07/Oct/21 ] | ||||||||
|
Thank you! | ||||||||
| Comment by Githook User [ 07/Oct/21 ] | ||||||||
|
Author: {'name': 'rstam', 'email': 'robert@robertstam.org', 'username': 'rstam'}Message: | ||||||||
| Comment by Robert Stam [ 22/Sep/21 ] | ||||||||
|
With a few minor changes `ToLowerInvariant` and `ToUpperInvariant` now work in the new LINQ implementation. Also, it works in combination with either `==` or `Equals`. | ||||||||
| Comment by Dmitry Lukyanov (Inactive) [ 21/Sep/21 ] | ||||||||
|
Hey richard.collette@gmail.com, thanks for your report, you're right that the c# "equal" operator works a bit different than the "Equals" method. Since there is a workaround with "=" operator, we're going to address this issue in the next LINQ implementation which is currently in code review. | ||||||||
| Comment by Richard Collette [ 17/Sep/21 ] | ||||||||
|
The same issue presents when using ToUpper().Equals() in a FindAsync operation. It works only if you do ToUpper() == . | ||||||||
| Comment by Richard Collette [ 17/Sep/21 ] | ||||||||
|
ToLowerInvariant does not work either. This may be specific to linq queries.
|