chore: Upgrade Mongoose from 5.13.23 to 6.13.6#2243
Closed
lucaslobatob wants to merge 8 commits intostagefrom
Closed
chore: Upgrade Mongoose from 5.13.23 to 6.13.6#2243lucaslobatob wants to merge 8 commits intostagefrom
lucaslobatob wants to merge 8 commits intostagefrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request updates Mongoose from version
5.13.23to6.13.6and refactors parts of the code to ensure full compatibility with the new version. The update required adjustments to typing, ObjectId handling, and connection configuration.As part of this migration, several methods and functions have been updated to use TypeScript typing, improving overall type safety, making better use of TypeScript inference capabilities, and reducing the risk of runtime errors. Additionally, the use of
Types.ObjectIdhas been standardized to use Mongoose'snew Types.ObjectId(), ensuring correct typing and consistency with the current Mongoose API.The MongoDB connection configuration has also been optimized. The following obsolete options have been removed:
useNewUrlParser,useUnifiedTopology,useFindAndModify, anduseCreateIndex. These options are no longer supported in Mongoose v6. The library now behaves as ifuseNewUrlParser,useUnifiedTopology, anduseCreateIndexare always set totrue, anduseFindAndModifytofalse. Keeping these options in the configuration generates warnings and is unnecessary, therefore they have been safely removed.No business logic was modified in this PR. The changes are focused exclusively on dependency upgrade, internal refactoring, and improving type correctness. The application was validated to ensure that database connections initialize correctly and that CRUD operations continue to function as expected without regressions.
Overall, this update modernizes the codebase, removes deprecated configurations, and strengthens type safety across the project.
Related Ticket #2230
Testing
Provide relevant testing instructions. What scenarios are impacted? What build may be necessary to test this change?
Developer Checklist
General
console.logor related logging is added.Backend Changes
Tests
Test IDs
Merge Request Review Checklist