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

Upgrade mongoose to v6.x #147

Open
sherryhli opened this issue Jan 14, 2022 · 1 comment
Open

Upgrade mongoose to v6.x #147

sherryhli opened this issue Jan 14, 2022 · 1 comment
Assignees

Comments

@sherryhli
Copy link
Member

sherryhli commented Jan 14, 2022

Context:

  • M0 clusters in Atlas may eventually be forced to upgrade to MongoDB v5.x (currently on v4.4.x)
  • Currently starter code uses Mongoose v5.x which uses MongoDB Node.js driver v3.x under the hood. v3.x drivers are not compatible with MongoDB v5.x
  • The solution is to upgrade to Mongoose v6.x, which uses MongoDB Node.js driver v4.x

Acceptance Criteria:

  • Carefully follow the Mongoose v6 migration guide to upgrade our version of Mongoose, ensure that all breaking changes are handled
  • Ensure that UserService and EntityService functions correctly when using the MongoDB implementation

Dev Notes:

  • MongoDB Node.js driver compatibility: https://docs.mongodb.com/drivers/node/current/compatibility/
  • Files to pay attention to:
    • backend/typescript/models/index.ts
    • backend/typescript/models/user.mgmodel.ts
    • backend/typescript/models/entity.mgmodel.ts
    • backend/typescript/services/implementations/EntityServiceMg.ts
    • backend/typescript/services/implementations/userService.ts
@gregmaxin
Copy link
Member

gregmaxin commented Feb 19, 2022

  • Upgraded Mongoose
  • poolSize replaced with minPoolSize and maxPoolSize
  • removed uses of useNewUrlParser, useUnifiedTopology, useFindAndModify, and useCreateIndex as they are no longer supported options.
  • Changd mongoose connection to use asPromise()
  • Checked for hardcoded errors - foudn none
  • No sanitizeFilter Found
  • No markModified Found

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

No branches or pull requests

2 participants