Skip to content

dependabot npm(deps): bump mongodb from 3.7.3 to 4.2.2

Kai Kretschmann requested to merge dependabot-npm_and_yarn-mongodb-4.2.2 into master

Bumps mongodb from 3.7.3 to 4.2.2.

Release notes

Sourced from mongodb's releases.

v4.2.2

The MongoDB Node.js team is pleased to announce version 4.2.2 of the mongodb package!

Bug Fixes

  • NODE-3705: ReadPreference.fromOptions omitting hedge and maxStalenessSeconds when readPreference is a string (#3060) (b9fbac5)
  • NODE-3711: retry txn end on retryable write (#3045) (7b00d0f)
  • NODE-3765: make replacement for replaceOne operations without _id (#3040) (e07e564)
  • stricter protocol check in connection string (#3078) (bc05671)

Documentation

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

v4.2.1

The MongoDB Node.js team is pleased to announce version 4.2.1 of the mongodb package!

Release Highlights

This release fixes an issue with the dbName being overridden by the authSource option. Additionally, we have ensured that cursors re-run server selection when fetching additional batches, which should reduce issues encountered in long running function as a service environments.

Bug Fixes

  • NODE-2370: correct a return type of hasNext() (#3058) (b6a63df)
  • NODE-3627: Enable flexible BSON validation for server error key containing invalid utf-8 (#3054) (7a507f0)
  • NODE-3648: run get more ops through server selection (#3030) (268e211)
  • NODE-3767: don't delete dbName if authSource is provided (#3055) (0a830e2)
  • NODE-3770: Filter type uses WithId on the schema (#3053) (307d623)

Documentation

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

v4.2.0

Release Highlights

This release includes a number of features we’re happy to announce. You can now run aggregation pipelines that write write to a MongoDB collection using $out and $merge stages on secondaries! We’ve added an option to limit the number of hosts the driver will connect to when using SRV DNS lookups to manage your host addresses. And lastly, the authorizedCollection option is now usable on the db.listCollections() function.

Additionally, in this release, we’ve marked collection.mapReduce() as deprecated. The same functionality can be replicated in the much more flexible aggregation pipeline. Visit Map-Reduce to Aggregation Pipeline to learn more.

The minimum supported MongoDB version is 3.6. Attempts to connect to a MongoDB server older than 3.6 will result in an error. Please take note of the MongoDB Software Lifecycle Schedules for timeframes of supported server versions.

... (truncated)

Changelog

Sourced from mongodb's changelog.

Changes in 4.x (and how to migrate!)

Hello dear reader, thank you for adopting version 4.x of the MongoDB Node.js driver, from the bottom of our developer hearts we thank you so much for taking the time to upgrade to our latest and greatest offering of a stunning database experience. We hope you enjoy your upgrade experience and this guide gives you all the answers you are searching for. If anything, and we mean anything, hinders your upgrade experience please let us know via JIRA. We know breaking changes are hard but they are sometimes for the best. Anyway, enjoy the guide, see you at the end!

Key Changes

Typescript

We've migrated the driver to Typescript! Users can now harness the power of type hinting and intellisense in editors that support it to develop their MongoDB applications. Even pure JavaScript projects can benefit from the type definitions with the right linting setup. Along with the type hinting there's consistent and helpful docs formatting that editors should be able to display while developing. Recently we migrated our BSON library to TypeScript as well, this version of the driver pulls in that change.

Community Types users (@​types/mongodb)

If you are a user of the community types (@​types/mongodb) there will likely be compilation errors while adopting the types from our codebase. Unfortunately we could not achieve a one to one match in types due to the details of writing the codebase in Typescript vs definitions for the user layer API along with the breaking changes of this major version. Please let us know if there's anything that is a blocker to upgrading on JIRA.

Node.js Version

We now require node 12.9 or greater for version 4 of the driver. If that's outside your support matrix at this time, that's okay! Bug fix support for our 3.x branch will not be ending until summer 2022, which has support going back as far as Node.js v4!

CRUD results

Our CRUD operations now return the drivers-wide spec-compliant results which are defined here:

For example, insertOne() used to return an object that was shaped like:

interface LegacyInsertOneResult {
    insertedCount: number;
    ops: InsertedDocument[];
    insertedId: ObjectId;
    connection: Connection;
    result: { ok: number; n: number };
}

and now returns:

</tr></table> 

... (truncated)

Commits
  • ea1f1f9 chore(release): 4.2.2
  • bc05671 fix: stricter protocol check in connection string (#3078)
  • 9d84765 chore: fix invalid use of typeof operator (#3076)
  • 3c041f4 revert(NODE-3784): Add enableUtf8Validation option" (#3073)
  • 9237d72 feat(NODE-3784): Add enableUtf8Validation option
  • e07e564 fix(NODE-3765): make replacement for replaceOne operations without _id (#3040)
  • f2dcc34 chore(NODE-3798): update dependencies; pull in mock server (#3067)
  • 8d1c94b refactor(NODE-3789):Update tests with oppressive language in their description
  • b53ec10 docs: Fix a typo in CONTRIBUTING.md (#3068)
  • 47c7893 refactor(NODE-3788): update names of offensive error codes (#3063)
  • Additional commits viewable in compare view

Merge request reports

Loading