MongoDB Node.js Driver v7.4.0

v7.4.0
Changed 2
  • Remove experimental tag from Symbol.asyncDispose methods on MongoClient, ClientSession, ChangeStream, and cursors to mark explicit resource management as stable
  • Send afterClusterTime on writes in causally-consistent sessions to maintain read your own writes guarantee across primary failovers in sharded clusters

From MongoDB Node.js Driver

7.4.0 (2026-06-25)

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

Release Notes
Explicit resource management is now stable

The Symbol.asyncDispose methods on MongoClient, ClientSession, ChangeStream, and cursors enable await using for automatic cleanup. These methods were introduced as experimental in v6.9.0. Since then, TC39 Explicit Resource Management proposal reached Stage 4 in 2025, and Node.js enabled explicit resource management as a stable feature in Node.js 24, so the experimental flags have been removed from our APIs and the APIs are now officially supported.

afterClusterTime now sent on writes in causally-consistent sessions

When a session has causal consistency enabled, write operations now include readConcern.afterClusterTime, matching the existing read behavior. This maintains the "read your own writes" guarantee across primary failovers in shareded clusters. There are no API changes.

Features
  • NODE-7634: remove experimental tag from async dispose methods (#4976) (43ce3eb)
  • NODE-7549: send afterClusterTime on writes in causally-consistent sessions (#4963) (3abfd26)
Documentation

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

View original

Upgraded? How did it go?

Discussion