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

BREAKING CHANGE: use mongodb@5, bson@5 #12955

Merged
merged 65 commits into from Feb 20, 2023
Merged

Conversation

vkarpov15
Copy link
Collaborator

Summary

Couple of notes: mongoose.Types.ObjectId() no longer works, need to do new mongoose.Types.ObjectId(). ObjectId class's _bsontype is now 'ObjectId', not 'ObjectID'.

MongoClient.connect() no longer supports callbacks. We will likely need to drop callback support as well in this version.

Examples

@vkarpov15 vkarpov15 marked this pull request as draft January 26, 2023 22:19
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.

from what i can tell, this PR is not final yet, is there a ETA for mongodb's 5.0 release?

things to note:

  • debug console.log's present
  • documentation not yet noting that new Types.ObjectId() is required now
  • something seems like it does not work (see tests)?
  • usage of alpha dependencies (mongodb, bson)

@hasezoey hasezoey added this to the 7.0 milestone Jan 26, 2023
@vkarpov15
Copy link
Collaborator Author

@hasezoey you can ignore this PR for now, it is a very rough draft and not close to ready for merge. We're not shipping this with alpha dependencies.

No formal ETA for mongodb@5 release, but I would expect to see that released within the next few weeks.

lib/connection.js Outdated Show resolved Hide resolved
@vkarpov15 vkarpov15 marked this pull request as ready for review February 12, 2023 22:14
@vkarpov15
Copy link
Collaborator Author

@hasezoey @AbdelrahmanHafez can you please take a look at this?

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.

What a bunch of changes, the tests look way better now than the old nesting.

  • it seems like the benchmark for update was deleted instead of updated, should there be a new one?
  • typescript types seem to not have been updated yet
  • there are conflicts with the base branch

i have mainly some questions & style changes.

docs/migrating_to_7.md Outdated Show resolved Hide resolved
docs/migrating_to_7.md Show resolved Hide resolved
docs/migrating_to_7.md Outdated Show resolved Hide resolved
docs/migrating_to_7.md Show resolved Hide resolved
docs/migrating_to_7.md Outdated Show resolved Hide resolved
lib/helpers/query/validOps.js Show resolved Hide resolved
test/docs/validation.test.js Outdated Show resolved Hide resolved
lib/drivers/node-mongodb-native/connection.js Show resolved Hide resolved
test/model.populate.test.js Show resolved Hide resolved
test/model.test.js Show resolved Hide resolved
vkarpov15 and others added 6 commits February 15, 2023 11:12
Co-authored-by: hasezoey <hasezoey@gmail.com>
Co-authored-by: hasezoey <hasezoey@gmail.com>
Co-authored-by: hasezoey <hasezoey@gmail.com>
Co-authored-by: hasezoey <hasezoey@gmail.com>
Copy link
Collaborator

@IslandRhythms IslandRhythms left a comment

Choose a reason for hiding this comment

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

LGTM

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.

LGTM

though noticed some missing Query.prototype functions in the callbacks removed section

docs/migrating_to_7.md Show resolved Hide resolved
lib/model.js Outdated Show resolved Hide resolved
test/query.test.js Outdated Show resolved Hide resolved
@hasezoey
Copy link
Collaborator

should this PR also update mquery, or should this be done after this PR?

see mongoosejs/mquery#137

…-changes

BREAKING CHANGE: remove callbacks from types, add notes about HydratedDocument changes
@vkarpov15
Copy link
Collaborator Author

@hasezoey we'll merge this PR into 7.0. Let's open a separate PR to bump mquery.

@vkarpov15 vkarpov15 merged commit f0f6c9e into 7.0 Feb 20, 2023
@hasezoey hasezoey deleted the vkarpov15/use-mongodb-node-driver-5 branch February 21, 2023 11:36
vkarpov15 added a commit to mongoosejs/in-memory-driver that referenced this pull request Jun 5, 2023
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

6 participants