-
Notifications
You must be signed in to change notification settings - Fork 2
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
[PROD-34066] Upgrades mongoose to version 7 and removes mongodb dependency #358
Conversation
4032814
to
fd12cdc
Compare
package.json
Outdated
@@ -66,7 +66,8 @@ | |||
"koa2-cors": "^2.0.6", | |||
"lodash": "^4.17.15", | |||
"log4js": "^6.7.1", | |||
"mongoose": "6.*", | |||
"mongodb": "~5.9.1", |
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.
❓ why so strict? why not "^5.9.1"
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 see in the compatibility table of mongo that they change support (upwards) using minor versions for the driver, so I opted to keep the minor version constant for orka as well. I changed it to ^
to be less restrictive.
package.json
Outdated
@@ -66,7 +66,8 @@ | |||
"koa2-cors": "^2.0.6", | |||
"lodash": "^4.17.15", | |||
"log4js": "^6.7.1", | |||
"mongoose": "6.*", | |||
"mongodb": "~5.9.1", | |||
"mongoose": "^7.6.7", |
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.
❓ since orka is in 4.0 beta, do we want to make it only mongo7 compatible? @nikostoulas WDYT?
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.
Sure! Let's use 7.* to not restrict apps from getting latest updates
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'll use the 7.*
notation for clarity
fd12cdc
to
c36fc05
Compare
@iliasbibas have you tried removing the dependency to mongodb altogether? |
|
c36fc05
to
2d24c14
Compare
@@ -81,7 +81,7 @@ const Joi: JoiWithExtensions = _Joi.extend( | |||
base: joi.string().meta({baseType: 'string'}), | |||
messages: {'objectId.invalid': 'Invalid objectId'}, | |||
validate: (value, helpers) => { | |||
return require('mongodb').ObjectId.isValid(value) | |||
return require('mongoose').isValidObjectId(value) |
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.
👏
2d24c14
to
3839853
Compare
Added
mongoose@^7.6.7
(latest 7.x) andmongodb@~5.9.1
.The reason for upgrading
mongoose
version is its official support for MongoDB 7.Developers of apps using mongoose through orka should keep in mind the migration guide for any breaking changes in the apps.