Skip to content

dependabot npm(deps): bump mongodb from 4.4.1 to 4.5.0

Depen d'Abot requested to merge dependabot-npm_and_yarn-mongodb-4.5.0 into master

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.

comment option support

The comment option is now widely available: by setting a comment on 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 serverHeartBeatFailure events that could be corrected to serverHeartBeatSucceeded 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 that T extends Document, a requirement that already had to be met by the underlying ChangeStreamDocument type.

Features

  • NODE-3697: reduce serverSession allocation (#3171) (5132bc9)
  • NODE-3699: add support for comment field (#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 comment field (#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 watch type parameter to extend ChangeStream type parameter (#3183) (43ba9fc)
Commits
  • 3dba3ae chore(release): 4.5.0
  • 6ffa661 docs: generate next version API documentation (#3188)
  • 43f748c chore(NODE-4153): make type fixes for ts 4.7 (#3185)
  • 0ed7cbf fix(NODE-3810): delay timeout errors by one event loop tick (#3180)
  • 4e2f9bf feat(NODE-3699): add support for comment field (#3167)
  • 43ba9fc fix(NODE-4129): constrain watch type parameter to extend ChangeStream typ...
  • 5132bc9 feat(NODE-3697): reduce serverSession allocation (#3171)
  • de9fd7f chore: add failpoint interface (#3181)
  • d2897ab feat(NODE-4085): add typings for csfle shared library option support (#3179)
  • d266158 chore: bump bson 4.6.1 -> 4.6.2 (#3178)
  • Additional commits viewable in compare view

Merge request reports