dependabot npm(deps): bump mongodb from 4.4.1 to 4.5.0
Bumps mongodb from 4.4.1 to 4.5.0.
Release notes
Sourced from mongodb's releases.
v4.5.0
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.
commentoption supportThe
commentoption is now widely available: by setting acommenton an operation you can trace its value in database logs for more insights.collection.insertOne( { name: 'spot' }, { comment: { started: new Date() } } )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.
{ "t": { "$date": "2022-04-04T16:08:56.079-04:00" }, "attr": { "commandArgs": { "documents": [ { "_id": "...", "name": "spot" } ], "comment": { "started": { "$date": "2022-04-04T20:08:56.072Z" } } } } }Socket timeout fixes for FaaS environments
This release includes a fix for serverless environments where transient
serverHeartBeatFailureevents that could be corrected toserverHeartBeatSucceededevents 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 thatTextends Document, a requirement that already had to be met by the underlyingChangeStreamDocumenttype.Features
- NODE-3697: reduce serverSession allocation (#3171) (5132bc9)
- NODE-3699: add support for
commentfield (#3167) (4e2f9bf)- NODE-4014: Add let option to bulk write operations (#3160) (6f633d1)
Bug Fixes
... (truncated)
Changelog
Sourced from mongodb's changelog.
4.5.0 (2022-04-04)
Features
- NODE-3697: reduce serverSession allocation (#3171) (5132bc9)
- NODE-3699: add support for
commentfield (#3167) (4e2f9bf)- NODE-4014: Add let option to bulk write operations (#3160) (6f633d1)
- NODE-4085: add typings for csfle shared library option support (#3179) (d2897ab)
Bug Fixes
- NODE-3769: retryable writes are not compliant with specification (#3144) (ff26b12)
- NODE-3810: delay timeout errors by one event loop tick (#3180) (0ed7cbf)
- NODE-4069: remove 'default' from options for fullDocument field in change stream options (#3169) (799689e)
- NODE-4074: ensure getTopology doesn't throw synchronously (#3172) (329f081)
- NODE-4129: constrain
watchtype parameter to extendChangeStreamtype parameter (#3183) (43ba9fc)
Commits
-
3dba3aechore(release): 4.5.0 -
6ffa661docs: generate next version API documentation (#3188) -
43f748cchore(NODE-4153): make type fixes for ts 4.7 (#3185) -
0ed7cbffix(NODE-3810): delay timeout errors by one event loop tick (#3180) -
4e2f9bffeat(NODE-3699): add support forcommentfield (#3167) -
43ba9fcfix(NODE-4129): constrainwatchtype parameter to extendChangeStreamtyp... -
5132bc9feat(NODE-3697): reduce serverSession allocation (#3171) -
de9fd7fchore: add failpoint interface (#3181) -
d2897abfeat(NODE-4085): add typings for csfle shared library option support (#3179) -
d266158chore: bump bson 4.6.1 -> 4.6.2 (#3178) - Additional commits viewable in compare view