diff --git a/config/redirects b/config/redirects index 5c37f64eb..48eb51b7c 100644 --- a/config/redirects +++ b/config/redirects @@ -1,6 +1,6 @@ define: prefix drivers/node define: base https://docs.mongodb.com/${prefix} -define: versions v3.6 v3.7 v4.0 v4.1 v4.2 v4.3 master +define: versions v3.6 v3.7 v4.0 v4.1 v4.2 v4.3 v4.4 master raw: ${prefix}/ -> ${base}/current/ raw: ${prefix}/stable -> ${base}/current/ diff --git a/snooty.toml b/snooty.toml index 9840469bb..9bfc038c4 100644 --- a/snooty.toml +++ b/snooty.toml @@ -1,11 +1,16 @@ name = "node" title = "Node.js" -toc_landing_pages = ["/fundamentals/authentication", "/fundamentals", "/fundamentals/crud", "/usage-examples"] +toc_landing_pages = [ + "/fundamentals/authentication", + "/fundamentals", + "/fundamentals/crud", + "/usage-examples", +] sharedinclude_root = "https://raw.githubusercontent.com/10gen/docs-shared/main/" [constants] -version = "4.3" +version = "4.4" package-name-org = "mongodb-org" pgp-version = "{+version+}" api = "https://mongodb.github.io/node-mongodb-native/{+version+}" diff --git a/source/compatibility.txt b/source/compatibility.txt index 8bce93bd1..e7a5768b2 100644 --- a/source/compatibility.txt +++ b/source/compatibility.txt @@ -10,6 +10,10 @@ Compatibility MongoDB Compatibility --------------------- +The following compatibility table specifies the recommended versions of +the {+driver-long+} for use with MongoDB. + +The first column lists the driver version. :ref:`What information does the MongoDB Compatibility table show? ` @@ -17,6 +21,10 @@ MongoDB Compatibility Language Compatibility ---------------------- +The following compatibility table specifies the recommended versions of +the {+driver-long+} for use with a specific version of Node.js. + +The first column lists the driver version. :ref:`What information does the Language Compatibility table show? ` diff --git a/source/fundamentals/typescript.txt b/source/fundamentals/typescript.txt index 004d1fff4..eeb93ac81 100644 --- a/source/fundamentals/typescript.txt +++ b/source/fundamentals/typescript.txt @@ -98,13 +98,13 @@ Type Safety and Dot Notation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If you specify a query or update with **dot notation**, the {+driver-short+} -provides type safety if your query or update does not +provides type safety if your query or update does not :ref:`reference a nested instance of a recursive type `. Dot notation is a syntax you can use to navigate nested JSON objects. The following code snippet defines the ``ClassificationPet`` interface, which includes a ``classification`` field that enables you to specify the -genus and color of dogs and cats: +genus and color of dogs and cats: .. code-block:: typescript @@ -131,18 +131,18 @@ The type error raised by the preceding code snippet is as follows: ... Type '"Sylvilagus"' is not assignable to type 'Condition<"Canis" | "Felis">'. -To learn more about dot notation, see +To learn more about dot notation, see :manual:`Dot Notation ` in the MongoDB manual. To learn more about the limitations of dot notation in the -{+driver-short+}, see the +{+driver-short+}, see the :ref:`` section. .. _node-driver-limitations: -Limitations of Driver Version {+version+} ---------------------------------- +Known Limitations +----------------- -.. include:: includes/limitations/{+version+}.rst +.. include:: includes/limitations/limits.rst diff --git a/source/includes/limitations/4.3.rst b/source/includes/limitations/limits.rst similarity index 93% rename from source/includes/limitations/4.3.rst rename to source/includes/limitations/limits.rst index e73db1a3a..26e43e29f 100644 --- a/source/includes/limitations/4.3.rst +++ b/source/includes/limitations/limits.rst @@ -1,5 +1,4 @@ -Learn about the following TypeScript specific limitations of -version 4.3 of the {+driver-short+}: +Learn about the following TypeScript specific limitations of the {+driver-short+}: - :ref:`No type safety for dot notation references to nested instances of recursive types ` - :ref:`No mutually recursive types ` @@ -9,6 +8,11 @@ version 4.3 of the {+driver-short+}: Recursive Types and Dot Notation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.. important:: Impacted Versions + + - 4.3 + - 4.4 + The {+driver-short+} cannot provide type safety within nested instances of **recursive types** referenced through dot notation. @@ -59,7 +63,7 @@ The following code snippet references a top-level instance of the The error raised by the preceding code snippet is as follows: .. code-block:: none - + index.ts(19,59): error TS2769: No overload matches this call. The last overload gave the following error. Type 'string' is not assignable to type 'Condition'. @@ -67,7 +71,7 @@ The error raised by the preceding code snippet is as follows: If you must have type safety within nested instances of recursive types, you must write your query or update without dot notation. -To learn more about dot notation, see +To learn more about dot notation, see :manual:`Dot Notation ` in the MongoDB manual. @@ -76,8 +80,12 @@ in the MongoDB manual. Mutual Recursion ~~~~~~~~~~~~~~~~ -You cannot specify a **mutually recursive** type as a type parameter in version -4.3 of the driver. +.. important:: Impacted Versions + + - 4.3 + - 4.4 + +You cannot specify a **mutually recursive** type as a type parameter. A mutually recursive type exists when two types contain a property that is of the other's type. You can update the diff --git a/source/includes/mongodb-compatibility-table-node.rst b/source/includes/mongodb-compatibility-table-node.rst index 13c086d06..ea9a8bb98 100644 --- a/source/includes/mongodb-compatibility-table-node.rst +++ b/source/includes/mongodb-compatibility-table-node.rst @@ -15,6 +15,18 @@ - MongoDB 3.2 - MongoDB 3.0 - MongoDB 2.6 + * - 4.4 + - ✓ + - ✓ + - ✓ + - ✓ + - ✓ + - ✓ + - ✓ + - + - + - + - * - 4.3 - ✓ - ✓ @@ -23,10 +35,10 @@ - ✓ - ✓ - ✓ - - - - - - - - + - + - + - + - * - 4.2 - ✓ - ✓ @@ -35,13 +47,13 @@ - ✓ - ✓ - ✓ - - - - - - - - + - + - + - + - * - 4.1 - - - - + - + - - ✓ - ✓ - ✓ @@ -52,8 +64,8 @@ - ✓ - ✓ * - 4.0 - - - - + - + - - ✓ - ✓ - ✓ @@ -64,8 +76,8 @@ - ✓ - ✓ * - 3.7 [#unified-topology]_ - - - - + - + - - ✓ - ✓ - ✓ @@ -76,9 +88,9 @@ - ✓ - ✓ * - 3.6 - - - - - - + - + - + - - ✓ - ✓ - ✓ @@ -88,10 +100,10 @@ - ✓ - ✓ * - 3.5 - - - - - - - - + - + - + - + - - ✓ - ✓ - ✓ @@ -100,10 +112,10 @@ - ✓ - ✓ * - 3.4 - - - - - - - - + - + - + - + - - ✓ - ✓ - ✓ @@ -112,10 +124,10 @@ - ✓ - ✓ * - 3.3 - - - - - - - - + - + - + - + - - ✓ - ✓ - ✓ @@ -124,11 +136,11 @@ - ✓ - ✓ * - 3.2.1 - - - - - - - - - - + - + - + - + - + - - ✓ - ✓ - ✓ @@ -136,11 +148,11 @@ - ✓ - ✓ * - 3.1 - - - - - - - - - - + - + - + - + - + - - ✓ - ✓ - ✓ @@ -148,51 +160,51 @@ - ✓ - ✓ * - 3.0 - - - - - - - - - - - - + - + - + - + - + - + - - ✓ - ✓ - ✓ - ✓ - ✓ * - 2.2.12 - - - - - - - - - - - - - - + - + - + - + - + - + - + - - ✓ - ✓ - ✓ - ✓ * - 2.0.14 - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - - ✓ - ✓ * - 1.4.29 - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - - ✓ - ✓ diff --git a/source/whats-new.txt b/source/whats-new.txt index 4da495071..f32aa1241 100644 --- a/source/whats-new.txt +++ b/source/whats-new.txt @@ -12,12 +12,36 @@ What's New Learn what's new in: +* :ref:`Version 4.4 ` * :ref:`Version 4.3 ` * :ref:`Version 4.2 ` * :ref:`Version 4.1 ` * :ref:`Version 4.0 ` * :ref:`Version 3.6 ` +.. _version-4.4: + +What's New in 4.4 +----------------- + +New features of the 4.4 Node.js driver release include: + +- KMIP provider support when using CSFLE. +- TLS support when using CSFLE. +- Hostname canonicalization now accepts "none", "forward", and "forwardAndReverse" as ``authMechanismProperties`` when using GSSAPI. +- In the 4.0.0 release of the driver, the deprecated ``collection.count()`` method was inadvertently changed to behave like ``collection.countDocuments()``. + In this release, the ``collection.count()`` method is updated to match legacy behavior: + + - If a query is provided, ``collection.count()`` behaves the same as ``collection.countDocuments()`` and performs a collection scan. + - If no query is provided, ``collection.count()`` behaves the same as ``collection.estimatedDocumentCount()`` and relies on + collection metadata. + + .. important:: Deprecation Notice + + The ``cursor.count()`` method is deprecated and will be removed in the next major version, along with ``collection.count()``. + Use the ``collection.estimatedDocumentCount()`` or ``collection.countDocuments()`` + methods instead. + .. _version-4.3: What's New in 4.3 @@ -55,6 +79,11 @@ New features of the 4.1 Node.js driver release include: What's New in 4.0 ----------------- +.. important:: + + In this release of the driver, the deprecated ``collection.count()`` method was inadvertently changed to + behave like ``collection.countDocuments()``. This behavior is corrected in :ref:`version 4.4 `. + New features of the 4.0 Node.js driver release include: TypeScript