-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update mongoDB backend mongoDB driver interface #1545
Conversation
This flag was deprecated since Mongo Server 3.7.4. Its presence in queries produce failures in the mongoDB driver when interfacing against Mongo Servers >= version 6.0.
Replace the mongo driver's delete calls with deleteMany to restore correct behavior with Mongo 6.0 while preserving compatibility with Mongo 5.0.
Replace the mongo driver's modify(update) calls with updateMany to restore correct behavior in Mongo 6.0 and above. The key change here is that the writeConcern is now back to being set based on environment context rather than being hardcoded to "0".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this PR needs some additional version bounds on the underlying mongo library. It seems like the interface is unchanged so it would be a patch version bump.
Match the current stack snapshot at version 2.7.1.2.
Hm, incompatible with GHC 8.4.4 because of We can do a follow-up PR to tighten our own base bounds and see what things we can adopt with 8.8 as our oldest compiler target. |
Co-authored-by: Matt Parsons <[email protected]>
OK, changes look good to me! Please add a changelog entry and a version bump for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AWesome thanks! I'll have this uploaded today.
The mongoDB driver library introduced breaking changes to the current API calls used in persistent when interfacing with a mongoDB Server version 6.0 and above. Two of those changes, namely the change in behavior of the delete and update functions, seem irrational to me, but regardless they're already officially incorporated.
This PR makes the necessary changes to restore expected functionality whilst remaining backwards compatible with previous mongoDB versions, namely MongoDB 5.0, the EOL for which comes up this October. As alluded to, these changes were prompted for the mongoDB upgrade effort at work.
The mongo driver package itself needs a little more work to conform the server spec changes brought along with the Mongo Wire version 17, however, that is independent of these changes.