Open Laskiri opened 4 days ago
Looks like it's an issue when using a version 20 of node with an old mongodb driver: https://jira.mongodb.org/browse/NODE-5802 and mongoose uses the mongodb driver under the hood.
The fix here is to just update mongoose to the latest version. We also have the mongodb driver installed without ever using it, as far as i can tell. Might as well remove that package while we are at it.
Maybe we should also bump the project to a newer version of node? 🤔 The backend is using version 12 while the frontend and mobile doesnt have a version specified. They should probably all use the same version for consistency if possible.
Looks like it's an issue when using a version 20 of node with an old mongodb driver: https://jira.mongodb.org/browse/NODE-5802 and mongoose uses the mongodb driver under the hood.
The fix here is to just update mongoose to the latest version. We also have the mongodb driver installed without ever using it, as far as i can tell. Might as well remove that package while we are at it.
Maybe we should also bump the project to a newer version of node? 🤔 The backend is using version 12 while the frontend and mobile doesnt have a version specified. They should probably all use the same version for consistency if possible.
Yeah updating mongose does resolve the warning, but also requires us to make a lot of small changes like using new keyforword for making ObjectID's :)
Find and replace all? 🤔 maybe we can get away with making a middleware that passes the objectID forward through the req
object. I have already kinda done this https://github.com/Educado-App/educado-backend/blob/main/middlewares/validateId.js
Find and replace all? 🤔 maybe we can get away with making a middleware that passes the objectID forward through the
req
object. I have already kinda done this https://github.com/Educado-App/educado-backend/blob/main/middlewares/validateId.js
The middleware looks like a great addition if we can seamlessly integrate it with all the relevant routes, if I understand it correctly then we can afterwards simply pass the req.id straight to the findOne methods etc?
straight
Ot req.ObjectId with the current naming
Issue Description
Briefly describe the issue you're facing.: When starting the server, a deprecation warning for the Mongo URL shows
Steps to Reproduce
Desired Behavior
No warnings when starting the server
Proposed Solution
Additional Information
Warning in terminal:
Other startup warnings was fixed in: https://github.com/Educado-App/educado-backend/commit/ea83949c568ec67f384d1926b76ff389cf41e225