Skip to content

chore(main): release 6.17.0 #4518

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Apr 22, 2025

🌱 A new release!

6.17.0 (2025-06-03)

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

Release Notes

keepAliveInitialDelay may now be configured at the MongoClient level

When not present will default to 120 seconds. The option value must be specified in milliseconds.

import { MongoClient } from 'mongodb';

const client = new MongoClient(process.env.MONGODB_URI, { keepAliveInitialDelay: 100000 });

updateOne and replaceOne now support a sort option

The updateOne and replaceOne operations in each of the ways they can be performed support a sort option starting in MongoDB 8.0. The driver now supports the sort option the same way it does for find or findOneAndModify-style commands:

const sort = { fieldName: -1 };

collection.updateOne({}, {}, { sort });
collection.replaceOne({}, {}, { sort }); 

collection.bulkWrite([ 
  { updateOne: { filter: {}, update: {}, sort } },
  { replaceOne: { filter: {}, replacement: {}, sort } },
]);

client.bulkWrite([
  { name: 'updateOne', namespace: 'db.test', filter: {}, update: {}, sort },
  { name: 'replaceOne', namespace: 'db.test', filter: {}, replacement: {}, sort }
]);

MongoClient close shuts outstanding in-use connections

The MongoClient.close() method now shuts connections that are in-use allowing the event loop to close if the only remaining resource was the MongoClient.

Support for MongoDB 4.0 is removed

When the driver connects to a MongoDB server of version 4.0 or less, it will now throw an error.

Support Added for Configuring the DEK cache expiration time.

Default value is 60000. Requires using mongodb-client-encryption >= 6.4.0

For ClientEncryption:

import { MongoClient, ClientEncryption } from 'mongodb';
const client = new MongoClient(process.env.MONGODB_URI);
const clientEncryption = new ClientEncryption(client, { keyExpirationMS: 100000, kmsProviders: ... });

For auto encryption:

import { MongoClient, ClientEncryption } from 'mongodb';
const client = new MongoClient(process.env.MONGODB_URI, {
  autoEncryption: {
    keyExpirationMS: 100000,
    kmsProviders: ...
  }
});

Fill in title or leave empty for no highlight

Update operations will now throw if ignoreUndefined is true and all operations are undefined.

When using any of the following operations they will now throw if all atomic operations in the update are undefined and the ignoreUndefined option is true. This is to avoid accidental replacement of the entire document with an empty document. Examples of this scenario:

import { MongoClient } from 'mongodb';

const client = new MongoClient(process.env.MONGODB_URI);

client.bulkWrite(
  [
    {
      name: 'updateMany',
      namespace: 'foo.bar',
      filter: { age: { $lte: 5 } },
      update: { $set: undefined, $unset: undefined }
    }
  ],
  { ignoreUndefined: true }
);

const collection = client.db('test').collection('test');

collection.bulkWrite(
  [
    {
      updateMany: {
        filter: { age: { $lte: 5 } },
        update: { $set: undefined, $unset: undefined }
      }
    }
  ],
  { ignoreUndefined: true }
);

collection.findOneAndUpdate(
  { a: 1 },
  { $set: undefined, $unset: undefined },
  { ignoreUndefined: true }
);

collection.updateOne({ a: 1 }, { $set: undefined, $unset: undefined }, { ignoreUndefined: true });

collection.updateMany({ a: 1 }, { $set: undefined, $unset: undefined }, { ignoreUndefined: true });

Socket errors are always treated as network errors

Network errors perform an important role in the driver, impacting topology monitoring processes and retryablity. A bug in the driver's socket implementation meant that in scenarios where server disconnects occurred while no operation was in progress on the socket resulted in errors that were not considered network errors.

Socket errors are now unconditionally treated as network errors.

Fill in title or leave empty for no highlight

Features

Bug Fixes

Documentation

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


@github-actions github-actions bot requested a review from a team as a code owner April 22, 2025 17:46
@github-actions github-actions bot force-pushed the release-please--branches--main--components--mongodb branch 5 times, most recently from 46957ea to 95c9e6d Compare April 28, 2025 19:04
@github-actions github-actions bot force-pushed the release-please--branches--main--components--mongodb branch 5 times, most recently from 18b3365 to 521d295 Compare May 6, 2025 16:25
@github-actions github-actions bot force-pushed the release-please--branches--main--components--mongodb branch 2 times, most recently from 07a4fc7 to bb9ff97 Compare May 13, 2025 17:04
@github-actions github-actions bot force-pushed the release-please--branches--main--components--mongodb branch 2 times, most recently from 0fae58f to 9592d86 Compare May 28, 2025 17:38
@github-actions github-actions bot force-pushed the release-please--branches--main--components--mongodb branch 2 times, most recently from 7e238b6 to 84fcaae Compare June 2, 2025 16:29
@baileympearson
Copy link
Contributor

run release_notes

@github-actions github-actions bot force-pushed the release-please--branches--main--components--mongodb branch from 84fcaae to dd74796 Compare June 2, 2025 21:19

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@github-actions github-actions bot force-pushed the release-please--branches--main--components--mongodb branch from dd74796 to 005212b Compare June 3, 2025 14:05
@durran durran changed the title chore(main): release 6.17.0 [skip-ci] chore(main): release 6.17.0 Jun 3, 2025
@durran
Copy link
Member

durran commented Jun 3, 2025

run release_notes

@durran durran closed this Jun 3, 2025
@durran durran deleted the release-please--branches--main--components--mongodb branch June 3, 2025 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants