Skip to content

Commit f24694f

Browse files
DOCSP-29718: typo fix and small copy edits. (#3107) (#3126)
* DOCSP-29718: typo fix and small copy edits. * DOCSP-29718: Internal feedback * DOCSP-29718: Internal feedback
1 parent 07c5b5a commit f24694f

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

source/reference/operator/aggregation/isNumber.txt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Definition
1717

1818
.. versionadded:: 4.4
1919

20-
:expression:`$isNumber` checks if the specified
20+
``$isNumber`` checks if the specified
2121
:ref:`expression <aggregation-expressions>` resolves to one of the
2222
following numeric :term:`BSON types`:
2323

@@ -26,16 +26,15 @@ Definition
2626
- :bsontype:`Double <Double>`
2727
- :bsontype:`Long <Int64>`
2828

29-
:expression:`$isNumber` returns:
29+
``$isNumber`` returns:
3030

3131
- ``true`` if the expression resolves to a number.
3232

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

37-
:expression:`$isNumber` has the following
38-
:ref:`operator expression syntax
37+
``$isNumber`` has the following :ref:`operator expression syntax
3938
<agg-quick-ref-operator-expressions>`:
4039

4140
.. code-block:: javascript
@@ -53,20 +52,20 @@ Definition
5352
Example
5453
-------
5554

56-
Use :expression:`$isNumber` to Check If A Field Is Numeric
57-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
55+
Use $isNumber to Check if a Field is Numeric
56+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5857

5958
Issue the following operation against the ``examples.sensors``
6059
collection to populate test data:
6160

6261
.. code-block:: javascript
6362

6463
db.getSiblingDB("examples").sensors.insertMany([
65-
{ "_id" : 1, "reading" : NumberDecimal(26.0) }
66-
{ "_id" : 2, "reading" : NumberLong(25.0) }
67-
{ "_id" : 3, "reading" : NumberInt(24) }
68-
{ "_id" : 4, "reading" : 24.0 }
69-
{ "_id" : 5, "reading" : "24" }
64+
{ "_id" : 1, "reading" : NumberDecimal(26.0) },
65+
{ "_id" : 2, "reading" : NumberLong(25.0) },
66+
{ "_id" : 3, "reading" : NumberInt(24) },
67+
{ "_id" : 4, "reading" : 24.0 },
68+
{ "_id" : 5, "reading" : "24" },
7069
{ "_id" : 6, "reading" : [ NumberDecimal(26) ]}
7170
])
7271

@@ -90,6 +89,7 @@ stage to add the following fields to each document:
9089
The aggregation operation returns the following results:
9190

9291
.. code-block:: javascript
92+
:copyable: false
9393

9494
{ "_id" : 1, "reading" : NumberDecimal("26.0000000000000"), "isNum " : true, "type" : "decimal" }
9595
{ "_id" : 2, "reading" : NumberLong(25), "isNum " : true, "type" : "long" }
@@ -98,8 +98,8 @@ The aggregation operation returns the following results:
9898
{ "_id" : 5, "reading" : "24", "isNum " : false, "type" : "string" }
9999
{ "_id" : 6, "reading" : [ NumberDecimal("26.0000000000000") ], "isNum " : false, "type" : "array" }
100100

101-
Conditionally Modify Fields using :expression:`$isNumber`
102-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
101+
Conditionally Modify Fields using $isNumber
102+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
103103

104104
The ``grades`` collection contains data on student grades. The ``grade``
105105
field may either store a string letter grade *or* a numeric point value.
@@ -136,7 +136,7 @@ field may either store a string letter grade *or* a numeric point value.
136136
The following aggregation uses the :pipeline:`$addFields` stage to add a
137137
``points`` field containing the numeric grade value for that course. The
138138
stage uses the :expression:`$cond` operator to set the value of
139-
``points`` based on the output of :expression:`$isNumber`:
139+
``points`` based on the output of ``$isNumber``:
140140

141141
- If ``true``, ``grades`` already contains the numeric point value.
142142
Set ``points`` equal to ``grades``.

0 commit comments

Comments
 (0)