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

source/release-notes/4.4-compatibility.txt

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -246,14 +246,13 @@ In earlier versions, a single emit can only hold half of MongoDB's
246246
Remove support for BSON Type JavaScript code with scope
247247
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
248248

249-
:dbcommand:`mapReduce` no longer supports the deprecated BSON type
250-
JavaScript code with scope (:doc:`BSON type 15
251-
</reference/bson-types/>`) for its functions. The ``map``,
252-
``reduce``, and ``finalize`` functions must be either BSON type
253-
String (:doc:`BSON type 2 </reference/bson-types/>`) or BSON type
254-
JavaScript (:doc:`BSON type 13 </reference/bson-types/>`). To pass
255-
constant values which will be accessible in the ``map``, ``reduce``,
256-
and ``finalize`` functions, use the ``scope`` parameter.
249+
:dbcommand:`mapReduce` no longer supports the deprecated :ref:`BSON
250+
type <bson-types>` JavaScript code with scope (BSON type 15) for its
251+
functions. The ``map``, ``reduce``, and ``finalize`` functions must be
252+
either BSON type String (BSON Type 2) or BSON type JavaScript
253+
(BSON Type 13). To pass constant values which will be accessible in
254+
the ``map``, ``reduce``, and ``finalize`` functions, use the ``scope``
255+
parameter.
257256

258257
The use of JavaScript code with scope for the :dbcommand:`mapReduce`
259258
functions has been deprecated since version 4.2.1.
@@ -432,20 +431,16 @@ BSON Type JavaScript code with scope
432431
Starting in MongoDB 4.4:
433432

434433
- :query:`$where` no longer supports the deprecated BSON type
435-
JavaScript code with scope (:doc:`BSON type 15
436-
</reference/bson-types/>`). The :query:`$where` operator only
437-
supports BSON type String (:doc:`BSON type 2
438-
</reference/bson-types/>`) or BSON type JavaScript (:doc:`BSON
439-
type 13 </reference/bson-types/>`).
434+
JavaScript code with scope (BSON Type 15). The :query:`$where`
435+
operator only supports BSON type String (BSON Type 2) or BSON type
436+
JavaScript (BSON Type 13).
440437

441438
- :dbcommand:`mapReduce` no longer supports the deprecated BSON type
442-
JavaScript code with scope (:doc:`BSON type 15
443-
</reference/bson-types/>`) for its functions. The ``map``,
444-
``reduce``, and ``finalize`` functions must be BSON type String
445-
(:doc:`BSON type 2 </reference/bson-types/>`) or BSON type JavaScript
446-
(:doc:`BSON type 13 </reference/bson-types/>`). To pass constant
447-
values which will be accessible in the ``map``, ``reduce``, and
448-
``finalize`` functions, use the ``scope`` parameter.
439+
JavaScript code with scope (BSON Type 15) for its functions. The
440+
``map``, ``reduce``, and ``finalize`` functions must be BSON type
441+
String (BSON Type 2) or BSON type JavaScript (BSON Type 13). To pass
442+
constant values which will be accessible in the ``map``, ``reduce``,
443+
and ``finalize`` functions, use the ``scope`` parameter.
449444

450445
The use of BSON type JavaScript code with scope for :query:`$where` and
451446
the :dbcommand:`mapReduce` functions has been deprecated since MongoDB

source/release-notes/4.4.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ New Aggregation Operators
526526
<Int64>`.
527527

528528
Returns boolean ``false`` if the expression resolves to any other
529-
:doc:`BSON type </reference/mongodb-extended-json>`, ``null``, or
529+
:ref:`BSON type <bson-types>`, ``null``, or
530530
a missing field
531531

532532
* - :expression:`$replaceOne`

source/tutorial/backup-and-restore-tools.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Deployments
4040
~~~~~~~~~~~
4141

4242
The :binary:`~bin.mongodump` and :binary:`~bin.mongorestore` utilities
43-
work with :doc:`BSON </reference/bson-types>` data dumps, and are
43+
work with :ref:`BSON <bson-types>` data dumps, and are
4444
useful for creating backups of small deployments. For resilient and
4545
non-disruptive backups, use a file system or block-level disk snapshot
4646
function, such as the methods described in the :doc:`/core/backups`
@@ -61,10 +61,10 @@ Binary BSON Dumps
6161
-----------------
6262

6363
The :binary:`~bin.mongorestore` and :binary:`~bin.mongodump` utilities work with
64-
:doc:`BSON </reference/bson-types>` data dumps, and are useful for creating
65-
backups of small deployments. For resilient and non-disruptive backups, use a
66-
file system or block-level disk snapshot function, such as the methods
67-
described in the :doc:`/core/backups` document.
64+
BSON data dumps, and are useful for creating backups of small deployments.
65+
For resilient and non-disruptive backups, use a file system or
66+
block-level disk snapshot function, such as the methods described in the
67+
:doc:`/core/backups` document.
6868

6969
Use these tools for backups if other backup methods, such as
7070
|mms-home| or

0 commit comments

Comments
 (0)