From 5bdcfed86b88377a956ba87b8ba9c1a2f3018718 Mon Sep 17 00:00:00 2001 From: Mike Woofter <108414937+mongoKart@users.noreply.github.com> Date: Fri, 13 Sep 2024 13:41:02 -0500 Subject: [PATCH] feedback --- source/whats-new.txt | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/source/whats-new.txt b/source/whats-new.txt index 6880324a..176391cf 100644 --- a/source/whats-new.txt +++ b/source/whats-new.txt @@ -66,6 +66,7 @@ What's New in 6.9 ----------------- - Support for {+mdb-server+} 3.6 is deprecated and will be removed in a future driver release. + - The driver natively supports explicit resource management for cursors and the ``MongoClient``, ``ClientSession``, and ``ChangeStream`` objects. When using a compatible Node.js version, you can implement explicit resource management by using the ``cursor.stream()`` @@ -76,6 +77,7 @@ What's New in 6.9 GitHub. For more information about explicit resource management, see the :github:`ECMAScript Explicit Resource Management Proposal ` on GitHub. + - If you're using Node.js 18.13 or later, you can pass the ``autoSelectFamily`` and ``autoSelectFamilyTimeout`` options to the ``MongoClient`` constructor. When the ``autoSelectFamily`` option is ``true``, the driver automatically selects between @@ -87,41 +89,57 @@ What's New in 6.9 .. code-block:: javascript :copyable: true - const client = new MongoClient(process.env.MONGODB_URI, { autoSelectFamily: true, autoSelectFamilyTimeout: 100 }); + const client = new MongoClient(url, + { autoSelectFamily: true, autoSelectFamilyTimeout: 100 }); + - The ``MongoClient`` constructor accepts the ``allowPartialTrustChain`` option. This option controls the ``X509_V_FLAG_PARTIAL_CHAIN`` OpenSSL flag. + - The ``ConnectionCheckedOutEvent`` and ``ConnectionCheckFailedEvent`` now include a ``durationMS`` property. This property indicates the time elapsed between the start and end of a connection checkout operation. + - If you're using Node.js 18 or later, the driver ignores the ``cryptoCallbacks`` option and uses callbacks defined in C++ instead, significantly improving encryption performance. This change is available in the v6.1.0 version of the ``mongodb-client-encryption`` package. + - To enhance security, the options specifying the spawn path and arguments for ``mongocryptd`` must be own properties of ``autoEncryption.extraOptions``. This change helps prevent global prototype pollution bugs related to these options. For more information about own properties, see `Object.hasOwn() `__ on MDN. -- Official support for Queryable Encryption (QE) range queries. To use this + +- Adds official support for Queryable Encryption (QE) range queries. To use this feature, your app must use ``mongodb-client-encryption`` v6.1.0 or later and must connect to {+mdb-server+} 8.0 or later. For more information about QE range queries, see :manual:`Queryable Encryption ` in the {+mdb-server+} manual. + - The ``insertMany()`` and ``bulkWrite()`` methods accept ``ReadonlyArray`` inputs. + - The driver retries writes based on the top-level code, found in ``error.code``, rather than the nested code in ``error.result.writeConcernError.code``. This fixes an issue in sharded clusters running versions {+mdb-server+} earlier than 4.4. + - The ``LocalKMSProviderConfiguration.key`` property accepts a ``BSON`` ``Binary`` instance for ``AutoEncryptionOptions``. -- In TypeScript, the ``BulkOperationBase`` class reports the ``length`` getter property. + +- In TypeScript, the ``BulkOperationBase`` class reports the ``length`` getter property. + - The ``MongoWriteConcernError`` type now preserves the original top-level code in ``MongoWriteConcernError.code``. + - The ``cursor.toArray()`` method empties the current batch of documents into the array before calling the async iterator again. This change avoids the delays associated with ``async``/``await`` execution and improves performance by up to 5% on average. This optimization doesn't apply if you provide a transform to the ``cursor.map()`` method before calling the ``toArray()`` method. + - Fixes mixed use of the ``cursor.next()`` method with ``for await`` syntax. -- Fixes the ``enableUtf8Validation`` when deserializing BSON. + +- Adds the ``enableUtf8Validation`` option when deserializing BSON, which was + inadvertently removed in {+driver-short+} v6.8. + - Adds the ``durationMS`` property to the ``ConnectionReadyEvent`` class. This property represents the time between the connection creation event and when the ``ConnectionReadyEvent`` fires.