build(deps): bump mongodb from 6.20.0 to 7.0.0#2192
Merged
madhavilosetty-intel merged 1 commit intomainfrom Jan 13, 2026
Merged
build(deps): bump mongodb from 6.20.0 to 7.0.0#2192madhavilosetty-intel merged 1 commit intomainfrom
madhavilosetty-intel merged 1 commit intomainfrom
Conversation
abe4d4d to
45c2f48
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR upgrades the MongoDB Node.js driver from version 6.20.0 to 7.0.0, a major version update that includes breaking changes and requires Node.js >= 20.19.0. The upgrade necessitated updates to the device update logic to handle ObjectId conversion properly.
Key Changes:
- Upgraded
mongodbpackage from 6.20.0 to 7.0.0 with corresponding dependency updates (bson,mongodb-connection-string-url,@types/whatwg-url) - Added ObjectId validation and conversion logic in the device update method
- Reformatted code in device routes for improved readability
- Applied formatting improvements to swagger.yaml
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| package.json | Upgraded mongodb dependency to version 7.0.0 |
| package-lock.json | Updated lockfile with MongoDB 7.0.0 and related dependency versions including bson 7.0.0 and updated peer dependency versions |
| src/data/mongo/collections/device.ts | Added validation for _id field and ObjectId conversion logic with support for both valid ObjectId strings and numeric IDs |
| src/routes/devices/index.ts | Reformatted redirectstatus route definition for better readability |
| swagger.yaml | Applied consistent formatting and whitespace cleanup throughout the API documentation |
Comments suppressed due to low confidence (1)
src/data/mongo/collections/device.ts:78
- The
findOneAndUpdatecall may returnnullif no document is found matching the filter criteria, but the method doesn't handle this case before returningresult as any. This will cause the method to returnnullwhen a device with the given_idandtenantIddoesn't exist, potentially leading to null reference errors in calling code.
Consider adding a null check:
if (!result) {
throw new Error(`Device not found with _id: ${objectId}`)
}
return result as any const result = await this.collection.findOneAndUpdate(
{ _id: objectId, tenantId: item.tenantId },
{ $set: item },
{ returnDocument: 'after', includeResultMetadata: false }
)
return result as any
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
45c2f48 to
7b972a5
Compare
f69e709 to
79d767b
Compare
rsdmike
approved these changes
Jan 13, 2026
|
🎉 This PR is included in version 2.26.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
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.
Bumps mongodb from 6.20.0 to 7.0.0.
Release notes
Sourced from mongodb's releases.
... (truncated)
Changelog
Sourced from mongodb's changelog.
... (truncated)
Commits
2512137chore(main): release 7.0.0 (#4667)e4881f5docs(NODE-7172): create v7 migration guide (#4751)53a4fb1docs: 6.21 docs (#4782)696664cfeat!(NODE-7286): update peer dependencies (#4780)517da84docs: add info about testing with different versions and the rosetta setup fo...252dab8test(NODE-7219): remove unused tests (#4767)76c98bbtest(NODE-5206): fix flaky sdam prose test (#4752)cb522bffix(NODE-7247): clarify #rewrapManyDataKey() parameter types (#4760)ec996e6chore(NODE-6945): remove dependency onv8-heapsnapshot(#4763)7d879fdtest(NODE-7280): remove test/mongodb.ts and its usage (#4766)You can trigger a rebase of this PR by commenting
@dependabot rebase.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot mergewill merge this PR after your CI passes on it@dependabot squash and mergewill squash and merge this PR after your CI passes on it@dependabot cancel mergewill cancel a previously requested merge and block automerging@dependabot reopenwill reopen this PR if it is closed@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)