Skip to content

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

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

Bumps mongodb from 4.5.0 to 4.6.0.

Release notes

Sourced from mongodb's releases.

v4.6.0

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 the operationType 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 properties to for rename events, as well as lsid, txnNumber, and clusterTime 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>(). Where X 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

  • NODE-2992: consider server load during server selection (#3219) (35eeba3)
  • NODE-4059: ChangeStreamDocument not fully typed to specification (#3191) (8b24212)

Bug Fixes

  • NODE-3565: Improve error message for insertMany with partially empty array (#3221) (0ef2516)
  • NODE-4232: stream() also returns generic AsyncIterable (ed4ba58)
  • NODE-3688: make handshake errors retryable (#3165) (3f8765a)
  • NODE-3833: return early on end if gridfs upload stream is already ended (#3223) (c27e844)
  • NODE-3928: don't throw error in Response constructor (#3199) (441fc63)
  • NODE-4031: options parsing for array options (#3193) (4b2e3d1)
  • NODE-4133: array field NestedPaths return type (#3184) (c46c984)
  • NODE-4156: remove comment from commands pre-4.4 (#3195) (4e6dccd)
  • NODE-4188: default localThresholdMS to 15ms (#3207) (5e730ff)
  • NODE-4208: add aws http request timeout handler (#3225) (829d7be)

Documentation

We invite you to try the mongodb library immediately, and report any issues to the NODE project.

v4.6.0-alpha.0

... (truncated)

Changelog

Sourced from mongodb's changelog.

4.6.0 (2022-05-11)

Features

  • NODE-4185: Allow opting out of disk use on cursor builder (#3230) (d216725)
  • NODE-4189: Add support for clustered collections (#3229) (79a917b)

Bug Fixes

  • NODE-3565: Improve error message for insertMany with partially empty array (#3221) (0ef2516)
  • NODE-4232: stream() also returns generic AsyncIterable (ed4ba58)

4.6.0-alpha.0 (2022-05-04)

Features

  • NODE-2992: consider server load during server selection (#3219) (35eeba3)
  • NODE-4059: ChangeStreamDocument not fully typed to specification (#3191) (8b24212)
  • NODE-4136: revise FLE shared library typings for spec changes (#3206) (6e2e27f)
  • NODE-4202: add FLE 2 behavior for create/drop collection (#3218) (6d3947b)

Bug Fixes

  • NODE-3688: make handshake errors retryable (#3165) (3f8765a)
  • NODE-3833: return early on end if gridfs upload stream is already ended (#3223) (c27e844)
  • NODE-3928: don't throw error in Response constructor (#3199) (441fc63)
  • NODE-4031: options parsing for array options (#3193) (4b2e3d1)
  • NODE-4133: array field NestedPaths return type (#3184) (c46c984)
  • NODE-4156: remove comment from commands pre-4.4 (#3195) (4e6dccd)
  • NODE-4188: default localThresholdMS to 15ms (#3207) (5e730ff)
  • NODE-4208: add aws http request timeout handler (#3225) (829d7be)
Commits
  • 273d8e7 chore(release): 4.6.0
  • 15f8870 test(NODE-4165): sync maxConnecting spec tests and update runner (#3239)
  • c6a2ddd chore(NODE-4162): removed TODO (#3242)
  • c12fef3 fix flakey operation count test (#3240)
  • ed4ba58 fix(NODE-4232): stream() also returns generic AsyncIterable
  • 8c16374 chore: use latest version of mongodb-client-encryption (#3238)
  • 0ef2516 fix(NODE-3565): Improve error message for insertMany with partially empty arr...
  • 79a917b feat(NODE-4189): Add support for clustered collections (#3229)
  • d216725 feat(NODE-4185): Allow opting out of disk use on cursor builder (#3230)
  • 3269a6e chore(release): 4.6.0-alpha.0
  • Additional commits viewable in compare view

Merge request reports