@@ -556,11 +556,11 @@ following form:
556556
557557.. code-block:: javascript
558558
559- db.people.findAndModify( {
560- query: { name: "Tom", state: "active", rating: { $gt: 10 } },
561- sort: { rating: 1 },
562- update: { $inc: { score: 1 } }
563- } );
559+ db.people.findAndModify( {
560+ query: { name: "Tom", state: "active", rating: { $gt: 10 } },
561+ sort: { rating: 1 },
562+ update: { $inc: { score: 1 } }
563+ } );
564564
565565However, the :method:`~db.collection.findAndModify()` shell helper
566566method returns only the unmodified document, or if ``new`` is
@@ -585,15 +585,15 @@ document or, if no matching document exists, create a new document:
585585
586586.. code-block:: javascript
587587
588- db.runCommand(
589- {
590- findAndModify: "people",
591- query: { name: "Gus", state: "active", rating: 100 },
592- sort: { rating: 1 },
593- update: { $inc: { score: 1 } },
594- upsert: true
595- }
596- )
588+ db.runCommand(
589+ {
590+ findAndModify: "people",
591+ query: { name: "Gus", state: "active", rating: 100 },
592+ sort: { rating: 1 },
593+ update: { $inc: { score: 1 } },
594+ upsert: true
595+ }
596+ )
597597
598598If the command finds a matching document, the command performs an update.
599599
0 commit comments