-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
refactor: upgrade mongodb from 3.6.11 to 4.1.1 #7586
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
Closed
Closed
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
Snyk has created this PR to upgrade mongodb from 3.6.11 to 4.1.1. See this package in npm: https://www.npmjs.com/package/mongodb See this project in Snyk: https://app.snyk.io/org/acinader/project/8c1a9edb-c8f5-4dc1-b221-4d6030a323eb?utm_source=github&utm_medium=upgrade-pr
Thanks for opening this pull request!
|
Codecov Report
@@ Coverage Diff @@
## master #7586 +/- ##
==========================================
- Coverage 93.98% 86.37% -7.61%
==========================================
Files 181 181
Lines 13354 13354
==========================================
- Hits 12551 11535 -1016
- Misses 803 1819 +1016
Continue to review full report at Codecov.
|
3 tasks
4 tasks
Member
|
Closing, as upgrade was made via #7794. |
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.
Snyk has created this PR to upgrade mongodb from 3.6.11 to 4.1.1.
ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.
Warning: This is a major version upgrade, and may be a breaking change.
Release notes
Package name: mongodb
-
4.1.1 - 2021-08-24
- This version of the driver brings in the latest BSON release which includes deserialization performance improvements.
- The snappy package recently released a major version bump (v7) that makes use of a rust implementation of Snappy compression. Our driver can now make use of this version (while maintaining compatibility with the previous v6).
interface Pet {
- NODE-3454: projection types are too narrow (#2924) (48d6da9)
- NODE-3468: remove generic overrides from find (#2935) (74bd7bd)
- NODE-3511: deprecate fullResponse and remove associated buggy code paths (#2943) (dfc39d1)
- NODE-3528: add support for snappy 7 (#2939) (0f7f300)
- NODE-3546: revert findOne not found result type to null (#2945) (1c576e9)
- NODE-3404 implement MongoRuntimeError children (#2912) (e69d99257)
- NODE-3405 implement MongoRuntimeError children (#2913) (e69d99257)
- Reference: https://docs.mongodb.com/drivers/node
- API: https://mongodb.github.io/node-mongodb-native/4.0
- Changelog: https://github.com/mongodb/node-mongodb-native/blob/4.1/HISTORY.md
-
4.1.0 - 2021-08-03
- NODE-2843: implement sessions advanceClusterTime method (#2920) (1fd0244)
- NODE-3011: Load Balancer Support (#2909) (c554a7a)
- NODE-2883: Aggregate Operation should not require parent parameter (#2918) (dc6e2d6)
- NODE-3058: accept null or undefined anywhere we permit nullish values (#2921) (b42a1b4)
- NODE-3441: fix typings for createIndexes (#2915) (f87f376)
- NODE-3442: AsyncIterator has incorrect return type (#2916) (4a10389)
- NODE-3452: readonly filters not permitted by typings (#2927) (ce51e78)
- NODE-3510: omit incorrect
- NODE-3513: default command monitoring to off (#2926) (3c60245)
- Reference: https://docs.mongodb.com/drivers/node
- API: https://mongodb.github.io/node-mongodb-native/4.0
- Changelog: https://github.com/mongodb/node-mongodb-native/blob/4.0/HISTORY.md
-
4.0.1 - 2021-07-20
- Webpack will no longer throw an error when trying to bundle the driver
- Snapshot sessions will now correctly apply the snapshot time when initiated with a distinct operation
- NODE-3199: unable to bundle driver due to uncaught require (#2904) (9e48bbd)
- NODE-3393: snapshot time not applied if distinct executed first (#2908) (7aa3008)
- NODE-3417: allow calling
- Reference: https://docs.mongodb.com/drivers/node
- API: https://mongodb.github.io/node-mongodb-native/4.0
- Changelog: https://github.com/mongodb/node-mongodb-native/blob/4.0/HISTORY.md
-
4.0.0 - 2021-07-13
-
4.0.0-beta.6 - 2021-07-01
-
4.0.0-beta.5 - 2021-05-26
-
4.0.0-beta.4 - 2021-05-18
-
4.0.0-beta.3 - 2021-04-06
-
4.0.0-beta.2 - 2021-03-16
-
4.0.0-beta.1 - 2021-02-02
-
4.0.0-beta.0 - 2021-01-19
-
3.7.1 - 2021-09-14
-
3.7.0 - 2021-08-31
-
3.6.12 - 2021-08-30
-
3.6.11 - 2021-08-05
from mongodb GitHub release notesThe MongoDB Node.js team is pleased to announce version 4.1.1 of the mongodb package!
Release Highlights
Error handling
We introduced better organization and consistency to our existing errors in an effort to provide more detailed error types that can help identify issues clearly and quickly. Our readme has a new section that describes how to handle errors thrown by the driver and defines our approach to semver in the context of errors. Notably, we recommend only using
instanceofchecks to filter for a given error class as we do not guarantee error messages or names will be preserved between patch releases, only the subclass hierarchy.Thanks so much to our summer interns @ andymina and @ W-A-James for undertaking this effort!
Notable fixes
findOne()once again correctly returnsnullwhen no match is found instead ofundefined. This change was unintentional and not consistent with our other APIs. It slipped through testing due to the nature ofundefinedandnullbeing nearly (==) but not actually (===) equal. We apologize if this results in the need for any code changes.This release also addresses some Typescript issues that require further explanation, let's dive in:
TypeScript support
Projections
Starting in MongoDB 4.4 projections can accept aggregation expressions and aggregation syntax.
This empowers users to create some pretty amazing and complex data model transformations on the database side.
Unfortunately, our initial release of typescript typing for projections was too narrow to allow these use cases and still pass the compiler checks.
Now projections are generic objects and the result of a cursor with a projection is typed as a generic object by default.
The recommended usage for projections alongside typescript is as follows:
name: string;
buddies: Pet[];
}
interface PetBuddyCount {
name: string;
buddyCount: number;
}
const pets = db.collection<Pet>('pets');
const petBuddyCounts = await pets.find().project<PetBuddyCount>({
name: 1,
buddyCount: { $size: '$buddies' },
}).toArray();
By using a parameterized
.projectcall you can now get the correct type information on thepetBuddyCountsarray.You will need to build the projection type yourself based on the projection you define for your query, but this has the benefit of constraining your results to precisely your type expectations.
Generics in find/findOne
In our initial typescript release the
findandfindOnemethods accepted a generic parameter that was passed to the filter argument of the API.Due to how typescript automatically resolves the types of generics, one could run into an issue when specifying a filter that was incorrectly typed.
The code below should be a Typescript error, TS hints to us the
nameis astringso it should only allow an array ofstringfor$in.It uses the incorrectly typed filter that does not match the schema of
Filter<TSchema>to automatically resolve a crazy return type.The function definition has now been updated to be:
So the Filter argument will no longer be automatically resolved to the passed in type, giving us the typescript compiler errors we love so much!
Bug Fixes
Refactoring
Documentation
We invite you to try the mongodb library immediately, and report any issues to the NODE project.
The MongoDB Node.js team is pleased to announce version 4.1.0 of the mongodb package!
Release Highlights
This release includes load balancer support, intended for use with the beta Serverless platform. When using the driver with Serverless, the SRV URI will automatically put the driver into this mode. When wanting to use a non-SRV URI one must add the
loadBalanced=trueoption to the URI to put the driver into this mode. Being in this mode enables the driver to properly route transactions and cursors to the correct service behind the load balancer.The release also fixes an important bug where the original release of the v4 driver enabled command monitoring by default, which caused many reported observations of performance degradation when upgrading from v3 of the driver. Command monitoring is now once again disabled by default and must be enabled by passing in
{ monitorCommands: true }to the client if desired.Features
Bug Fixes
| voidin declaration of Promise overload ofrename()(#2922) (58c1e84)Documentation
We invite you to try the mongodb library immediately, and report any issues to the NODE project.
The MongoDB Node.js team is pleased to announce version 4.0.1 of the mongodb package!
Release Highlights
This release fixes two small but important bugs from our 4.0.0 release:
We hope this improves your upgrade experience!
Bug Fixes
db()before MongoClient is connected (#2889) (51ea86d)Documentation
We invite you to try the mongodb library immediately, and report any issues to the NODE project.
Read more
Read more
Read more
Read more
Commit messages
Package name: mongodb
Compare
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.
For more information:
🧐 View latest project report
🛠 Adjust upgrade PR settings
🔕 Ignore this dependency or unsubscribe from future upgrade PRs