Skip to content

Commit bfb79cb

Browse files
author
Dave
authored
Docsp 19904 update db collection.insert pt2 v5.1 (#76)
* DOCSP-19904 update db.collection.insert pt2 * Two more pages via includes * Remove unused includes * Update spacing * Spacing
1 parent 976300f commit bfb79cb

12 files changed

+22
-137
lines changed

source/includes/extracts-projection.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ content: |
311311
312312
.. code-block:: javascript
313313
314-
db.players.insert( {
314+
db.players.insertOne( {
315315
name: "player1",
316316
games: [ { game: "abc", score: 8 }, { game: "xyz", score: 5 } ],
317317
joined: new Date("2020-01-01"),

source/includes/fact-sparse-index-hint-count.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ index results in an incorrect count.
66

77
.. code-block:: javascript
88
9-
db.collection.insert({ _id: 1, y: 1 } );
9+
db.collection.insertOne( { _id: 1, y: 1 } );
1010
db.collection.createIndex( { x: 1 }, { sparse: true } );
1111
1212
db.collection.find().hint( { x: 1 } ).count();
@@ -19,5 +19,5 @@ documents in a collection.
1919
2020
db.collection.find().count();
2121
22-
db.collection.createIndex({ y: 1 });
23-
db.collection.find().hint({ y: 1 }).count();
22+
db.collection.createIndex( { y: 1 } );
23+
db.collection.find().hint( { y: 1 } ).count();

source/includes/fact-type-fidelity-loss-example.rst

Lines changed: 0 additions & 48 deletions
This file was deleted.

source/includes/let-example-create-flavors.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ Create a collection ``cakeFlavors``:
22

33
.. code-block:: javascript
44
5-
db.cakeFlavors.insert( [
5+
db.cakeFlavors.insertMany( [
66
{ _id: 1, flavor: "chocolate" },
77
{ _id: 2, flavor: "strawberry" },
88
{ _id: 3, flavor: "cherry" }
9-
] )
9+
] )
10+

source/includes/let-variables-example.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Create a collection ``cakeSales`` containing sales for cake flavors:
22

33
.. code-block:: javascript
44
5-
db.cakeSales.insert( [
5+
db.cakeSales.insertMany( [
66
{ _id: 1, flavor: "chocolate", salesTotal: 1580 },
77
{ _id: 2, flavor: "strawberry", salesTotal: 4350 },
88
{ _id: 3, flavor: "cherry", salesTotal: 2150 }

source/includes/steps-authorization-create-users.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,5 +180,5 @@ content: |
180180
181181
.. code-block:: javascript
182182
183-
db.foo.insert( { x: 1, y: 1 } )
183+
db.foo.insertOne( { x: 1, y: 1 } )
184184
...

source/includes/steps-test-generate-multiple-documents.yaml

Lines changed: 0 additions & 67 deletions
This file was deleted.

source/includes/table-transactions-operations.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070

7171
* - | :method:`db.collection.insertMany()`
7272
| :method:`db.collection.insertOne()`
73-
| :method:`db.collection.insert()`
7473
7574
- :dbcommand:`insert`
7675

source/reference/command/aggregate.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,12 +521,12 @@ Create a collection ``foodColl`` with the following documents:
521521

522522
.. code-block:: javascript
523523

524-
db.foodColl.insert([
524+
db.foodColl.insertMany( [
525525
{ _id: 1, category: "cake", type: "chocolate", qty: 10 },
526526
{ _id: 2, category: "cake", type: "ice cream", qty: 25 },
527527
{ _id: 3, category: "pie", type: "boston cream", qty: 20 },
528528
{ _id: 4, category: "pie", type: "blueberry", qty: 15 }
529-
])
529+
] )
530530

531531
Create the following indexes:
532532

source/reference/command/collMod.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ For example, the following insert operation violates the validation rule.
426426

427427
.. code-block:: javascript
428428

429-
db.contacts.insert( { name: "Amanda", status: "Updated" } )
429+
db.contacts.insertOne( { name: "Amanda", status: "Updated" } )
430430

431431
However, since the ``validationAction`` is ``warn`` only, MongoDB only
432432
logs the validation violation message and allows the operation to

0 commit comments

Comments
 (0)