Skip to content

Commit

Permalink
DOCSP-43533 - Version 6.9 (mongodb#902)
Browse files Browse the repository at this point in the history
Co-authored-by: Rea Rustagi <[email protected]>
  • Loading branch information
mongoKart and rustagir authored Sep 13, 2024
1 parent 65dd8cc commit 45572a9
Show file tree
Hide file tree
Showing 5 changed files with 113 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config/redirects
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
define: prefix docs/drivers/node
define: base https://www.mongodb.com/${prefix}
define: versions v3.6 v3.7 v4.0 v4.1 v4.2 v4.3 v4.4 v4.5 v4.6 v4.7 v4.8 v4.9 v4.10 v4.11 v4.12 v4.13 v4.14 v4.15 v4.16 v4.17 v5.0 v5.1 v5.2 v5.3 v5.4 v5.5 v5.6 v5.7 v5.8 v5.9 v6.0 v6.1 v6.2 v6.3 v6.4 v6.5 v6.6 v6.7 v6.8 master
define: versions v3.6 v3.7 v4.0 v4.1 v4.2 v4.3 v4.4 v4.5 v4.6 v4.7 v4.8 v4.9 v4.10 v4.11 v4.12 v4.13 v4.14 v4.15 v4.16 v4.17 v5.0 v5.1 v5.2 v5.3 v5.4 v5.5 v5.6 v5.7 v5.8 v5.9 v6.0 v6.1 v6.2 v6.3 v6.4 v6.5 v6.6 v6.7 v6.8 v6.9 master

symlink: current -> master

Expand Down
2 changes: 1 addition & 1 deletion snooty.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ toc_landing_pages = [
sharedinclude_root = "https://raw.githubusercontent.com/10gen/docs-shared/main/"

[constants]
version = "6.8"
version = "6.9"
api = "https://mongodb.github.io/node-mongodb-native/{+version+}"
driver-long = "MongoDB Node.js driver"
driver-short = "Node.js driver"
Expand Down
9 changes: 6 additions & 3 deletions source/fundamentals/monitoring/connection-monitoring.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ connectionReady
ConnectionReadyEvent {
time: 2023-02-13T15:56:38.291Z,
address: '...',
connectionId: 1
connectionId: 1,
durationMS: 60
}

connectionClosed
Expand Down Expand Up @@ -197,7 +198,8 @@ connectionCheckOutFailed
ConnectionCheckOutFailedEvent {
time: 2023-02-13T15:56:38.291Z,
address: '...',
reason: ...
reason: ...,
durationMS: 60
}

connectionCheckedOut
Expand All @@ -209,7 +211,8 @@ connectionCheckedOut
ConnectionCheckedOutEvent {
time: 2023-02-13T15:54:07.188Z,
address: '...',
connectionId: 1
connectionId: 1,
durationMS: 60
}

connectionCheckedIn
Expand Down
17 changes: 16 additions & 1 deletion source/includes/mongodb-compatibility-table-node.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,21 @@
- MongoDB 3.0
- MongoDB 2.6

* - 6.0 to 6.9
* - 6.9
- ✓
- ✓
- ✓
- ✓
- ✓
- ✓
- ✓
- ✓ [#server-3.6-deprecated]_
-
-
-
-

* - 6.0 to 6.8
- ⊛
- ✓
- ✓
Expand Down Expand Up @@ -214,3 +228,4 @@
- ✓

.. [#unified-topology] When using Node.js Driver version 3.7, you must set the ``useUnifiedTopology`` flag to ``true`` for certain features.
.. [#server-3.6-deprecated] Support for MongoDB 3.6 is deprecated in {+driver-short+} v6.9.
89 changes: 89 additions & 0 deletions source/whats-new.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ What's New

Learn what's new in:

* :ref:`Version 6.9 <version-6.9>`
* :ref:`Version 6.8 <version-6.8>`
* :ref:`Version 6.7 <version-6.7>`
* :ref:`Version 6.6 <version-6.6>`
Expand Down Expand Up @@ -59,6 +60,94 @@ Learn what's new in:
* :ref:`Version 3.7 <version-3.7>`
* :ref:`Version 3.6 <version-3.6>`

.. _version-6.9:

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()``
method and ``GridFSDownloadStream`` class.

To learn how to use explicit resource management, see the
:github:`v6.9.0 Release Notes <mongodb/node-mongodb-native/releases/tag/v6.9.0>` on
GitHub. For more information about explicit resource management, see the
:github:`ECMAScript Explicit Resource Management Proposal </tc39/proposal-explicit-resource-management>`
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
an IPv4 or IPv6 connection. The ``autoSelectFamilyTimeout`` option specifies the
timeout, in milliseconds, for the driver to select the connection family.

The following code example shows how to use these options:

.. code-block:: javascript
:copyable: true

const client = new MongoClient(uri,
{ 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() <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwn>`__
on MDN.

- 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 <core/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.

- 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.

- 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.

To learn more about this release, see the
:github:`v6.9.0 Release Notes <mongodb/node-mongodb-native/releases/tag/v6.9.0>` on
GitHub.

.. _version-6.8:

What's New in 6.8
Expand Down

0 comments on commit 45572a9

Please sign in to comment.