From d4d3a343978198de85d78c8fd9d3d2daa3b82e7f Mon Sep 17 00:00:00 2001 From: Jordan Smith Date: Tue, 6 Dec 2022 11:46:31 -0800 Subject: [PATCH 1/2] selective backport DOCSP-25723 --- source/fundamentals/typescript.txt | 14 ++------------ source/includes/limitations/limits.rst | 12 +++--------- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/source/fundamentals/typescript.txt b/source/fundamentals/typescript.txt index eb1848c6e..bd41d6781 100644 --- a/source/fundamentals/typescript.txt +++ b/source/fundamentals/typescript.txt @@ -44,8 +44,7 @@ For more information on object types, see the Type Parameters that Extend Document ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The following classes accept all types that both extend -the ``Document`` interface and are not mutually recursive: +The following classes accept all types that extend the ``Document`` interface: .. _node-mongodb-type-parameters-extend-document: @@ -71,14 +70,10 @@ You can pass a type parameter that extends the ``Document`` interface like this: :start-after: start-no-key :end-before: end-no-key -To view an example of a mutually recursive type, which is not supported by the -:ref:`preceding classes `, -see the :ref:`` section. - Type Parameters of Any Type ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The following classes accept all type parameters that are not mutually recursive: +The following classes accept all type parameters: .. _node-mongodb-type-parameters-any-type: @@ -89,11 +84,6 @@ You can find a code snippet that shows how to specify a type for the ``FindCurso class in the :ref:`Find Multiple Documents Usage Example `. -To view an example of a mutually recursive type, which is not supported by the -:ref:`preceding classes `, -see the :ref:`` section. - - Type Safety and Dot Notation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/source/includes/limitations/limits.rst b/source/includes/limitations/limits.rst index 26e43e29f..96390ad8f 100644 --- a/source/includes/limitations/limits.rst +++ b/source/includes/limitations/limits.rst @@ -8,11 +8,6 @@ Learn about the following TypeScript specific limitations 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. @@ -82,8 +77,9 @@ Mutual Recursion .. important:: Impacted Versions - - 4.3 - - 4.4 + In this driver version, you cannot specify a mutually recursive type as a + type parameter. To specify a mutually recursive type as a type parameter, + use version 4.11 or newer. You cannot specify a **mutually recursive** type as a type parameter. @@ -115,5 +111,3 @@ following error: error TS2615: Type of property 'r' circularly references itself in mapped type '{ [Key in keyof MutuallyRecursive]... -If you must apply a mutually recursive type to your classes, use version 4.2 of -the {+driver-short+}. From 22aea90890b2c21d526d8976492c639df7bb35b8 Mon Sep 17 00:00:00 2001 From: Jordan Smith Date: Tue, 6 Dec 2022 11:53:47 -0800 Subject: [PATCH 2/2] remove admonition title --- source/includes/limitations/limits.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/includes/limitations/limits.rst b/source/includes/limitations/limits.rst index 96390ad8f..5968aa797 100644 --- a/source/includes/limitations/limits.rst +++ b/source/includes/limitations/limits.rst @@ -75,7 +75,7 @@ in the MongoDB manual. Mutual Recursion ~~~~~~~~~~~~~~~~ -.. important:: Impacted Versions +.. important:: In this driver version, you cannot specify a mutually recursive type as a type parameter. To specify a mutually recursive type as a type parameter,