Skip to content
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

Move all MongoDB-specific connection logic into driver layer, add createClient() method to handle creating MongoClient #13542

Merged
merged 2 commits into from Jul 4, 2023

Conversation

vkarpov15
Copy link
Collaborator

Summary

Pulling in some work we started on with #4292 work (see vkarpov15/gh-4292 branch). One of the annoying pain points in building the in-memory driver was that we couldn't import Mongoose's Connection class without importing all of MongoDB. The driver layer is supposed to abstract that out, but connections have a bunch of MongoDB references that should really be in the driver layer.

Examples

Copy link
Collaborator

@hasezoey hasezoey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, though i would recommend to merge this into the next minor version instead of a patch

await Cat.create({ name: 'test123' });
let doc = await Cat.findOne({ name: 'test123' });
const old = doc.updatedAt;
await new Promise(resolve => setTimeout(resolve, 10));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what requires this sleep?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test flaked once while I was testing, so I figured I'd make this test more robust while it was fresh in my mind. This test doesn't always fail, but you can see that without the sleep this test can fail.

@vkarpov15 vkarpov15 added this to the 7.4.0 milestone Jun 26, 2023
@vkarpov15 vkarpov15 changed the base branch from master to 7.4 June 26, 2023 13:05
@vkarpov15
Copy link
Collaborator Author

Switched base branch to 7.4 👍

@vkarpov15 vkarpov15 merged commit eb16d8d into 7.4 Jul 4, 2023
32 of 34 checks passed
@vkarpov15 vkarpov15 deleted the vkarpov15/openuri-refactor branch July 4, 2023 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants