Summary
The latest MongoDB.Driver for C# switched the default LINQ Provider from 2 to 3 but is severely lacking in the "Breaking Changes" section of the release notes. We updated our project to use the latest driver, addressed the issues called out in breaking changes such as the ObjectSerializer changes.
We then began seeing errors like the following:
"ExpressionNotSupportedException: ... because negative indexes are not valid. To use the positional operator $ use FirstMatchingElement instead of an index value of -1."
Great.. so clearly based on the error message, this is a "known" change but I had to do some web searching just to find https://jira.mongodb.org/browse/CSHARP-4079 which nonchalantly says something like "Oh, we're going to be replacing these 3 things with these 3 extension methods" and closes the issue. That's all well and good except where is this called out in the documentation or more importantly the breaking changes section? Where is the page that documents what to look out for or change when moving from LINQ2 to LINQ3 provider? If it exists, that's great but it also needs to be more discoverable and should be listed in the breaking changes section of the 2.19.0 driver release. If it doesn't exist, please create one because I have no idea what else is going to bite me in this code base due to undocumented changes (at least undocumented from the standpoint of I couldn't find anything).
I will try the MongoDB Analyzer now as I was not previously aware of this and it is not called out in the release notes for 2.19.x.
- related to
-
CSHARP-4079 Implement positional update operators in LINQ3
- Closed