diff --git a/source/reference/method/db.collection.findOneAndUpdate.txt b/source/reference/method/db.collection.findOneAndUpdate.txt index bf1f2ad43f8..1ac5eb4d318 100644 --- a/source/reference/method/db.collection.findOneAndUpdate.txt +++ b/source/reference/method/db.collection.findOneAndUpdate.txt @@ -117,7 +117,7 @@ and increments the score by ``5``: .. code-block:: javascript - db.scores.findOneAndUpdate( + db.grades.findOneAndUpdate( { "name" : "R. Stiles" }, { $inc: { "points" : 5 } } ) @@ -153,7 +153,7 @@ matching document with the least points. .. code-block:: javascript - db.scores.findOneAndUpdate( + db.grades.findOneAndUpdate( { "name" : "A. MacDyver" }, { $inc : { "points" : 5 } }, { sort : { "points" : 1 } } @@ -175,7 +175,7 @@ The following operation uses projection to only display the ``_id``, .. code-block:: javascript - db.scores.findOneAndUpdate( + db.grades.findOneAndUpdate( { "name" : "A. MacDyver" }, { $inc : { "points" : 5 } }, { sort : { "points" : 1 }, projection: { "assignment" : 1, "points" : 1 } } @@ -199,7 +199,7 @@ The following operation sets a 5ms time limit to complete the update: .. code-block:: javascript try { - db.scores.findOneAndUpdate( + db.grades.findOneAndUpdate( { "name" : "A. MacDyver" }, { $inc : { "points" : 5 } }, { sort: { "points" : 1 }, maxTimeMS : 5 }; @@ -227,7 +227,7 @@ document if nothing matches the ``filter``: .. code-block:: javascript try { - db.scores.findOneAndUpdate( + db.grades.findOneAndUpdate( { "name" : "A.B. Abracus" }, { $set: { "name" : "A.B. Abracus", "assignment" : 5}, $inc : { "points" : 5 } }, { sort: { "points" : 1 }, upsert:true, returnNewDocument : true }