refactor: upgrade mongodb from 4.5.0 to 4.6.0 #8022
Merged
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.
This PR was automatically created by Snyk using the credentials of a real user.
Snyk has created this PR to upgrade mongodb from 4.5.0 to 4.6.0.
ℹ️ 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.
Release notes
Package name: mongodb
The MongoDB Node.js team is pleased to announce version 4.6.0 of the mongodb package!
Release Highlights
TypeScript: ChangeStreamDocument
Our change stream document type and watch API have undergone some improvements! You can now define your own custom type for the top level document returned in a
'change'
event. This is very useful when using a pipeline that significantly changes the shape of the change document (ex.$replaceRoot
,$project
operators). Additionally, we've improved the type information of the default change stream document to default to union of the possible events from MongoDB. This works well with typescript's ability to narrow a Discriminated Union based on theoperationType
key in the default change stream document.Prior to this change the
ChangeStreamDocument
inaccurately reflected the runtime shape of the change document. Now, using the union, we correctly indicate that some properties do not exist at all on certain events (as opposed to being optional). With this typescript fix we have added the propertiesto
for rename events, as well aslsid
,txnNumber
, andclusterTime
if the change is from within a transaction.NOTE: Updating to this version may require fixing typescript issues. Those looking to adopt this version but defer any type corrections can use the watch API like so:
.watch<any, X>()
. WhereX
controls the type of the change document for your use case.Check out the examples and documentation here.
Performance: Consider Server Load During Server Selection
Operations will now be directed towards servers that have fewer in progress operations, distributing the load more evenly across servers.
Note
This release includes some experimental features that are not yet ready for use. As a reminder, anything marked experimental is not a part of the official driver API and is subject to change without notice.
Features
Bug Fixes
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 v4.6.0-alpha.0 of the mongodb package!
Release Highlights
This release is for internal testing - NOT intended for use production.
Features
Bug Fixes
Documentation
The MongoDB Node.js team is pleased to announce version 4.5.0 of the mongodb package!
Release Highlights
This release includes a number of enhancements noted below.
comment
option supportThe
comment
option is now widely available: by setting acomment
on an operation you can trace its value in database logs for more insights.An example of a log line, trimmed for brevity. We can see the timestamp of the log and the time created on our client application differ.
Socket timeout fixes for FaaS environments
This release includes a fix for serverless environments where transient
serverHeartBeatFailure
events that could be corrected toserverHeartBeatSucceeded
events in the next tick of the event loop were nonetheless handled as an actual issue with the client's connection and caused unnecessary resource clean up routines.It turns out that since Node.js handles timeout events first in the event loop, socket timeouts expire while the FaaS environment is dormant and the timeout handler code is the first thing that runs upon function wake prior to checking for any data from the server. Delaying the timeout handling until after the data reading phase avoids the sleep-induced timeout error in the cases where the connection is still healthy.
TS fixes for 4.7
Typescript 4.7 may not be out yet but in preparation for its release we've fixed issues compiling against that version. The main new obstacle was defaulting generic arguments that require that the constraining condition enforce similarity with the defaulted type. You may notice that our change stream
watch<T extends Document = Document>()
methods now requires thatT
extends Document, a requirement that already had to be met by the underlyingChangeStreamDocument
type.Features
comment
field (#3167) (4e2f9bf)Bug Fixes
watch
type parameter to extendChangeStream
type parameter (#3183) (43ba9fc)Documentation
We invite you to try the mongodb library immediately, and report any issues to the NODE project.
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