@@ -19,6 +19,7 @@ What's New
1919
2020Learn what's new in:
2121
22+ * :ref:`Version 6.9 <version-6.9>`
2223* :ref:`Version 6.8 <version-6.8>`
2324* :ref:`Version 6.7 <version-6.7>`
2425* :ref:`Version 6.6 <version-6.6>`
@@ -59,6 +60,94 @@ Learn what's new in:
5960* :ref:`Version 3.7 <version-3.7>`
6061* :ref:`Version 3.6 <version-3.6>`
6162
63+ .. _version-6.9:
64+
65+ What's New in 6.9
66+ -----------------
67+
68+ - Support for {+mdb-server+} 3.6 is deprecated and will be removed in a future driver release.
69+
70+ - The driver natively supports explicit resource management for cursors and the
71+ ``MongoClient``, ``ClientSession``, and ``ChangeStream`` objects. When using a compatible Node.js
72+ version, you can implement explicit resource management by using the ``cursor.stream()``
73+ method and ``GridFSDownloadStream`` class.
74+
75+ To learn how to use explicit resource management, see the
76+ :github:`v6.9.0 Release Notes <mongodb/node-mongodb-native/releases/tag/v6.9.0>` on
77+ GitHub. For more information about explicit resource management, see the
78+ :github:`ECMAScript Explicit Resource Management Proposal </tc39/proposal-explicit-resource-management>`
79+ on GitHub.
80+
81+ - If you're using Node.js 18.13 or later, you can pass the ``autoSelectFamily`` and
82+ ``autoSelectFamilyTimeout`` options to the ``MongoClient`` constructor. When the
83+ ``autoSelectFamily`` option is ``true``, the driver automatically selects between
84+ an IPv4 or IPv6 connection. The ``autoSelectFamilyTimeout`` option specifies the
85+ timeout, in milliseconds, for the driver to select the connection family.
86+
87+ The following code example shows how to use these options:
88+
89+ .. code-block:: javascript
90+ :copyable: true
91+
92+ const client = new MongoClient(uri,
93+ { autoSelectFamily: true, autoSelectFamilyTimeout: 100 });
94+
95+ - The ``MongoClient`` constructor accepts the ``allowPartialTrustChain`` option. This option
96+ controls the ``X509_V_FLAG_PARTIAL_CHAIN`` OpenSSL flag.
97+
98+ - The ``ConnectionCheckedOutEvent`` and ``ConnectionCheckFailedEvent`` now include a ``durationMS``
99+ property. This property indicates the time elapsed between the start and end of a
100+ connection checkout operation.
101+
102+ - If you're using Node.js 18 or later, the driver ignores the ``cryptoCallbacks`` option
103+ and uses callbacks defined in C++ instead, significantly improving encryption
104+ performance. This change is available in the v6.1.0 version of the ``mongodb-client-encryption`` package.
105+
106+ - To enhance security, the options specifying the spawn path and arguments for
107+ ``mongocryptd`` must be own properties of ``autoEncryption.extraOptions``.
108+ This change helps prevent global prototype pollution bugs related to these options.
109+ For more information about own properties, see
110+ `Object.hasOwn() <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwn>`__
111+ on MDN.
112+
113+ - Adds official support for Queryable Encryption (QE) range queries. To use this
114+ feature, your app must use ``mongodb-client-encryption`` v6.1.0 or later and must connect
115+ to {+mdb-server+} 8.0 or later. For more information about QE range queries, see
116+ :manual:`Queryable Encryption <core/queryable-encryption>` in the {+mdb-server+} manual.
117+
118+ - The ``insertMany()`` and ``bulkWrite()`` methods accept ``ReadonlyArray`` inputs.
119+
120+ - The driver retries writes based on the top-level code, found in ``error.code``, rather
121+ than the nested code in ``error.result.writeConcernError.code``. This fixes an issue
122+ in sharded clusters running versions {+mdb-server+} earlier than 4.4.
123+
124+ - The ``LocalKMSProviderConfiguration.key`` property accepts a ``BSON`` ``Binary`` instance
125+ for ``AutoEncryptionOptions``.
126+
127+ - In TypeScript, the ``BulkOperationBase`` class reports the ``length`` getter property.
128+
129+ - The ``MongoWriteConcernError`` type now preserves the original top-level code in
130+ ``MongoWriteConcernError.code``.
131+
132+ - The ``cursor.toArray()`` method empties the current batch of documents into the array
133+ before calling the async iterator again. This change avoids the delays associated
134+ with ``async``/``await`` execution and improves performance by up to 5% on average.
135+ This optimization doesn't apply if you provide a transform to the ``cursor.map()`` method
136+ before calling the ``toArray()`` method.
137+
138+ - Fixes mixed use of the ``cursor.next()`` method with ``for await`` syntax.
139+
140+ - Adds the ``enableUtf8Validation`` option when deserializing BSON, which was
141+ inadvertently removed in {+driver-short+} v6.8.
142+
143+ - Adds the ``durationMS`` property to the ``ConnectionReadyEvent`` class. This property
144+ represents the time between the connection creation event and when the ``ConnectionReadyEvent``
145+ fires.
146+
147+ To learn more about this release, see the
148+ :github:`v6.9.0 Release Notes <mongodb/node-mongodb-native/releases/tag/v6.9.0>` on
149+ GitHub.
150+
62151.. _version-6.8:
63152
64153What's New in 6.8
0 commit comments