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

[PROD-34066] Upgrades mongoose to version 7 and removes mongodb dependency #358

Merged
merged 1 commit into from
Jan 5, 2024

Conversation

iliasbibas
Copy link
Contributor

@iliasbibas iliasbibas commented Jan 4, 2024

Added mongoose@^7.6.7 (latest 7.x) and mongodb@~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.

@iliasbibas iliasbibas force-pushed the change/PROD-34066-upgrade-mongo-7 branch from 4032814 to fd12cdc Compare January 4, 2024 15:23
@iliasbibas iliasbibas marked this pull request as ready for review January 4, 2024 15:26
@iliasbibas iliasbibas requested a review from Nikoklis January 4, 2024 15:26
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",
Copy link
Contributor

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"

Copy link
Contributor Author

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",
Copy link
Contributor

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?

Copy link
Contributor

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

Copy link
Contributor Author

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

@iliasbibas iliasbibas force-pushed the change/PROD-34066-upgrade-mongo-7 branch from fd12cdc to c36fc05 Compare January 4, 2024 15:56
@nikostoulas
Copy link
Contributor

@iliasbibas have you tried removing the dependency to mongodb altogether?

@iliasbibas
Copy link
Contributor Author

iliasbibas commented Jan 4, 2024

@iliasbibas have you tried removing the dependency to mongodb altogether?

Working on it, I'll get back to you once done.
@nikostoulas Removed the dependency.

@iliasbibas iliasbibas force-pushed the change/PROD-34066-upgrade-mongo-7 branch from c36fc05 to 2d24c14 Compare January 5, 2024 09:12
@iliasbibas iliasbibas changed the title [PROD-34066] Upgrades mongoose to version 7 and adds mongodb package [PROD-34066] Upgrades mongoose to version 7 and removes mongodb dependency Jan 5, 2024
@@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

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

👏

@iliasbibas iliasbibas force-pushed the change/PROD-34066-upgrade-mongo-7 branch from 2d24c14 to 3839853 Compare January 5, 2024 14:13
@iliasbibas iliasbibas merged commit 71d2f2d into master Jan 5, 2024
4 checks passed
@iliasbibas iliasbibas deleted the change/PROD-34066-upgrade-mongo-7 branch January 5, 2024 14:22
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.

4 participants