Skip to content

Commit 7c832ae

Browse files
authored
DOCPS-26298 updates BSON-related doc directives (#2105)
* DOCPS-26298 updates BSON-related doc directives * internal review feedback * internal review feedback
1 parent 4ace17b commit 7c832ae

17 files changed

+87
-120
lines changed

source/core/map-reduce.txt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,12 @@ map and reduce operation, such as perform additional calculations.
6060
.. note::
6161

6262
Starting in MongoDB 4.4, :dbcommand:`mapReduce` no longer supports
63-
the deprecated BSON type JavaScript code with scope
64-
(:doc:`BSON type 15 </reference/bson-types/>`) for its functions. The
65-
``map``, ``reduce``, and ``finalize`` functions must be either BSON
66-
type String (:doc:`BSON type 2 </reference/bson-types/>`) or
67-
BSON type JavaScript (:doc:`BSON type 13 </reference/bson-types/>`).
68-
To pass constant values which will be accessible in the ``map``,
69-
``reduce``, and ``finalize`` functions, use the ``scope`` parameter.
63+
the deprecated :ref:`BSON type <bson-types>` JavaScript code with
64+
scope (BSON Type 15) for its functions. The ``map``, ``reduce``,
65+
and ``finalize`` functions must be either BSON type String
66+
(BSON Type 2) or BSON type JavaScript (BSON Type 13). To pass
67+
constant values which will be accessible in the ``map``, ``reduce``,
68+
and ``finalize`` functions, use the ``scope`` parameter.
7069

7170
The use of JavaScript code with scope for the :dbcommand:`mapReduce`
7271
functions has been deprecated since version 4.2.1.

source/includes/extracts-agg-operators.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@ content: |
937937
<Int64>`.
938938
939939
Returns boolean ``false`` if the expression resolves to any
940-
other :doc:`BSON type </reference/mongodb-extended-json>`,
940+
other :ref:`BSON type <bson-types>`,
941941
``null``, or a missing field.
942942
943943
.. versionadded:: 4.4

source/includes/parameters-map-reduce.rst

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,10 @@ The ``map`` function has the following requirements:
3333
starting in version 4.4.
3434

3535
- Starting in MongoDB 4.4, :dbcommand:`mapReduce` no longer supports
36-
the deprecated BSON type JavaScript code with scope
37-
(:doc:`BSON type 15 </reference/bson-types/>`) for its functions. The
38-
``map`` function must be either BSON type String (:doc:`BSON type 2
39-
</reference/bson-types/>`) or BSON type JavaScript (:doc:`BSON type 13
40-
</reference/bson-types/>`). To pass constant values which will be
36+
the deprecated :ref:`BSON Type <bson-types>` JavaScript code with
37+
scope (BSON Type 15) for its functions. The ``map`` function must be
38+
either BSON Type String (BSON Type 2) or BSON Type JavaScript
39+
(BSON Type 13). To pass constant values which will be
4140
accessible in the ``map`` function, use the ``scope`` parameter.
4241

4342
| The use of JavaScript code with scope for the ``map`` function has
@@ -102,12 +101,11 @@ The ``reduce`` function exhibits the following behaviors:
102101
joined together in subsequent ``reduce`` steps.
103102

104103
- Starting in MongoDB 4.4, :dbcommand:`mapReduce` no longer supports
105-
the deprecated BSON type JavaScript code with scope
106-
(:doc:`BSON type 15 </reference/bson-types/>`) for its functions. The
107-
``reduce`` function must be either BSON type String (:doc:`BSON type 2
108-
</reference/bson-types/>`) or BSON type JavaScript (:doc:`BSON type 13
109-
</reference/bson-types/>`). To pass constant values which will be
110-
accessible in the ``reduce`` function, use the ``scope`` parameter.
104+
the deprecated BSON Type JavaScript code with scope (BSON Type 15)
105+
for its functions. The ``reduce`` function must be either BSON Type
106+
String (BSON Type 2) or BSON Type JavaScript (BSON Type 13). To pass
107+
constant values which will be accessible in the ``reduce`` function,
108+
use the ``scope`` parameter.
111109

112110
| The use of JavaScript code with scope for the ``reduce`` function
113111
has been deprecated since version 4.2.1.
@@ -286,13 +284,11 @@ aware that:
286284
the ``scope`` parameter.
287285

288286
- Starting in MongoDB 4.4, :dbcommand:`mapReduce` no longer supports
289-
the deprecated BSON type JavaScript code with scope
290-
(:doc:`BSON type 15 </reference/bson-types/>`) for its functions. The
291-
``finalize`` function must be either BSON type String
292-
(:doc:`BSON type 2 </reference/bson-types/>`) or BSON type JavaScript
293-
(:doc:`BSON type 13 </reference/bson-types/>`). To pass constant
294-
values which will be accessible in the ``finalize`` function, use the
295-
``scope`` parameter.
287+
the deprecated BSON Type JavaScript code with scope (BSON Type 15) for
288+
its functions. The ``finalize`` function must be either BSON Type
289+
String (BSON Type 2) or BSON Type JavaScript (BSON Type 13). To pass
290+
constant values which will be accessible in the ``finalize`` function,
291+
use the ``scope`` parameter.
296292

297293
| The use of JavaScript code with scope for the ``finalize`` function
298294
has been deprecated since version 4.2.1.

source/reference/aggregation-variables.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Variables in Aggregation Expressions
1313
:ref:`Aggregation expressions <aggregation-expressions>` can use both
1414
user-defined and system variables.
1515

16-
Variables can hold any :doc:`BSON type data </reference/bson-types>`.
16+
Variables can hold any :ref:`BSON type data <bson-types>`.
1717
To access the value of the variable, prefix the variable name with
1818
double dollar signs (``$$``); i.e. ``"$$<variable>"``.
1919

source/reference/command/mapReduce.txt

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,8 @@ The command takes the following fields as arguments:
8686

8787
A JavaScript function that associates or "maps" a ``value``
8888
with a ``key`` and emits the ``key`` and value ``pair``. You
89-
can specify the function as BSON type JavaScript (i.e.
90-
:doc:`BSON type 13 </reference/bson-types/>`) or String (i.e.
91-
:doc:`BSON type 2 </reference/bson-types/>`).
89+
can specify the function as :ref:`BSON type <bson-types>`
90+
Javascript (BSON Type 13) or String (BSON Type 2).
9291

9392
For more information, see :ref:`Requirements for the map Function
9493
<mapreduce-map-cmd>`.
@@ -99,9 +98,8 @@ The command takes the following fields as arguments:
9998

10099
A JavaScript function that "reduces" to a single object all
101100
the ``values`` associated with a particular ``key``. You can
102-
specify the function as BSON type JavaScript (i.e.
103-
:doc:`BSON type 13 </reference/bson-types/>`) or String (i.e.
104-
:doc:`BSON type 2 </reference/bson-types/>`).
101+
specify the function as BSON type JavaScript (BSON Type 13) or
102+
String (BSON Type 2).
105103

106104
For more information, see :ref:`Requirements for the reduce
107105
Function <mapreduce-reduce-cmd>`.
@@ -148,9 +146,7 @@ The command takes the following fields as arguments:
148146

149147
Optional. A JavaScript function that modifies the output after
150148
the ``reduce`` function. You can specify the function as
151-
BSON type JavaScript (i.e.
152-
:doc:`BSON type 13 </reference/bson-types/>`) or String (i.e.
153-
:doc:`BSON type 2 </reference/bson-types/>`).
149+
BSON type JavaScript (BSON Type 13) or String (BSON Type 2).
154150

155151
For more information, see :ref:`Requirements for the finalize
156152
Function <mapreduce-finalize-cmd>`.

source/reference/method/db.collection.mapReduce.txt

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,8 @@ Syntax
7474

7575
- A JavaScript function that associates or "maps" a ``value`` with
7676
a ``key`` and emits the ``key`` and value ``pair``. You can
77-
specify the function as BSON type JavaScript (i.e. :doc:`BSON
78-
type 13 </reference/bson-types/>`) or String (i.e. :doc:`BSON
79-
type 2 </reference/bson-types/>`).
77+
specify the function as :ref:`BSON type <bson-types>` JavaScript
78+
(BSON Type 13) or String (BSON Type 2).
8079

8180
See :ref:`mapreduce-map-mtd` for more information.
8281

@@ -88,9 +87,8 @@ Syntax
8887

8988
- A JavaScript function that "reduces" to a single object all the
9089
``values`` associated with a particular ``key``. You can specify
91-
the function as BSON type JavaScript (i.e. :doc:`BSON type 13
92-
</reference/bson-types/>`) or String (i.e. :doc:`BSON type 2
93-
</reference/bson-types/>`).
90+
the function as BSON type JavaScript (BSON Type 13) or String
91+
(BSON Type 2).
9492

9593
See :ref:`mapreduce-reduce-mtd` for more information.
9694

@@ -172,8 +170,7 @@ The following table describes additional arguments that
172170

173171
- Optional. A JavaScript function that modifies the output after
174172
the ``reduce`` function. You can specify the function as BSON type
175-
JavaScript (i.e. :doc:`BSON type 13 </reference/bson-types/>`)
176-
or String (i.e. :doc:`BSON type 2 </reference/bson-types/>`).
173+
JavaScript (BSON Type 13) or String (BSON Type 2).
177174

178175
See :ref:`mapreduce-finalize-mtd` for more information.
179176

source/reference/operator/aggregation/bucket.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ or the operation throws an error:
181181
- A :ref:`default <bucket-default>` value is specified to bucket
182182
documents whose ``groupBy``
183183
values are outside of the ``boundaries`` or of a different
184-
:doc:`BSON type </reference/bson-types>` than the values in
184+
:ref:`BSON type <bson-types>` than the values in
185185
``boundaries``.
186186

187187
If the ``groupBy`` expression resolves to an array or a document,

source/reference/operator/aggregation/isNumber.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Definition
3131
- ``true`` if the expression resolves to a number.
3232

3333
- ``false`` if the expression resolves to any other
34-
:doc:`BSON type </reference/mongodb-extended-json>`, ``null``, or
34+
:ref:`BSON type <bson-types>`, ``null``, or
3535
a missing field.
3636

3737
:expression:`$isNumber` has the following

source/reference/operator/aggregation/type.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ Definition
1515

1616
.. expression:: $type
1717

18-
Returns a string that specifies the :doc:`BSON type
19-
</reference/bson-types/>` of the argument.
18+
Returns a string that specifies the :ref:`BSON type
19+
<bson-types>` of the argument.
2020

2121
:expression:`$type` has the following :ref:`operator expression
2222
syntax <agg-quick-ref-operator-expressions>`:

source/reference/operator/query/where.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@ Definition
3030
.. note::
3131

3232
Starting in MongoDB 4.4, :query:`$where` no longer supports the
33-
deprecated BSON type JavaScript code with scope (:ref:`BSON type 15
34-
<bson-types>`). The :query:`$where` operator only
35-
supports BSON type String (:ref:`BSON type 2 <bson-types>`) or
36-
BSON type JavaScript (:ref:`BSON type 13 <bson-types>`). The use of
37-
BSON type JavaScript with scope for :query:`$where` has been
33+
deprecated :ref:`BSON type <bson-types>` JavaScript code with scope
34+
(BSON Type 15). The :query:`$where` operator only supports BSON type
35+
String (BSON Type 2) or BSON type JavaScript (BSON Type 13). The use
36+
of BSON type JavaScript with scope for :query:`$where` has been
3837
deprecated since MongoDB 4.2.1.
3938

4039
.. note:: Aggregation Alternatives Preferred

0 commit comments

Comments
 (0)