Skip to content

Commit a55fdfa

Browse files
zhugwkay-kim
authored andcommitted
Update db.collection.findOneAndUpdate.txt
scores ==> grades
1 parent 75bddc0 commit a55fdfa

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ and increments the score by ``5``:
117117

118118
.. code-block:: javascript
119119

120-
db.scores.findOneAndUpdate(
120+
db.grades.findOneAndUpdate(
121121
{ "name" : "R. Stiles" },
122122
{ $inc: { "points" : 5 } }
123123
)
@@ -153,7 +153,7 @@ matching document with the least points.
153153

154154
.. code-block:: javascript
155155

156-
db.scores.findOneAndUpdate(
156+
db.grades.findOneAndUpdate(
157157
{ "name" : "A. MacDyver" },
158158
{ $inc : { "points" : 5 } },
159159
{ sort : { "points" : 1 } }
@@ -175,7 +175,7 @@ The following operation uses projection to only display the ``_id``,
175175

176176
.. code-block:: javascript
177177

178-
db.scores.findOneAndUpdate(
178+
db.grades.findOneAndUpdate(
179179
{ "name" : "A. MacDyver" },
180180
{ $inc : { "points" : 5 } },
181181
{ sort : { "points" : 1 }, projection: { "assignment" : 1, "points" : 1 } }
@@ -199,7 +199,7 @@ The following operation sets a 5ms time limit to complete the update:
199199
.. code-block:: javascript
200200

201201
try {
202-
db.scores.findOneAndUpdate(
202+
db.grades.findOneAndUpdate(
203203
{ "name" : "A. MacDyver" },
204204
{ $inc : { "points" : 5 } },
205205
{ sort: { "points" : 1 }, maxTimeMS : 5 };
@@ -227,7 +227,7 @@ document if nothing matches the ``filter``:
227227
.. code-block:: javascript
228228

229229
try {
230-
db.scores.findOneAndUpdate(
230+
db.grades.findOneAndUpdate(
231231
{ "name" : "A.B. Abracus" },
232232
{ $set: { "name" : "A.B. Abracus", "assignment" : 5}, $inc : { "points" : 5 } },
233233
{ sort: { "points" : 1 }, upsert:true, returnNewDocument : true }

0 commit comments

Comments
 (0)