@@ -1154,7 +1154,7 @@ Create a collection ``orders`` with the following documents:
1154
1154
1155
1155
.. code-block:: javascript
1156
1156
1157
- db.orders.insert ( [
1157
+ db.orders.insertMany ( [
1158
1158
{ _id: 1, item: "apple", qty: 5, price: 10 },
1159
1159
{ _id: 2, item: "pie", qty: 10, price: NumberDecimal("20.0") },
1160
1160
{ _id: 3, item: "ice cream", qty: 2, price: "4.99" },
@@ -1201,10 +1201,26 @@ converts the ``price`` to a decimal:
1201
1201
The operation returns the following documents:
1202
1202
1203
1203
.. code-block:: javascript
1204
+ :copyable: false
1204
1205
1205
- { "_id" : 1, "totalPrice" : NumberDecimal("50.0000000000000") }
1206
- { "_id" : 2, "totalPrice" : NumberDecimal("200.0") }
1207
- { "_id" : 3, "totalPrice" : NumberDecimal("9.98") }
1208
- { "_id" : 4, "totalPrice" : NumberDecimal("0") }
1209
- { "_id" : 5, "totalPrice" : "NaN" }
1206
+ { _id: 1, totalPrice: Decimal128("50") },
1207
+ { _id: 2, totalPrice: Decimal128("200.0") },
1208
+ { _id: 3, totalPrice: Decimal128("9.98") },
1209
+ { _id: 4, totalPrice: Decimal128("0") },
1210
+ { _id: 5, totalPrice: 'NaN' }
1211
+
1212
+ .. note::
1213
+
1214
+ The legacy :binary:`~bin.mongo` shell stores decimals as
1215
+ NumberDecimal. In :binary:`~bin.mongo` shell, the operation returns
1216
+ the following documents:
1217
+
1218
+ .. code-block:: javascript
1219
+ :copyable: false
1220
+
1221
+ { "_id" : 1, "totalPrice" : NumberDecimal("50.0000000000000") }
1222
+ { "_id" : 2, "totalPrice" : NumberDecimal("200.0") }
1223
+ { "_id" : 3, "totalPrice" : NumberDecimal("9.98") }
1224
+ { "_id" : 4, "totalPrice" : NumberDecimal("0") }
1225
+ { "_id" : 5, "totalPrice" : "NaN" }
1210
1226
0 commit comments