Skip to content

Commit 72166cf

Browse files
author
Dave
authored
DOCSP-20124 updates for update (#163) (#185)
1 parent 480751a commit 72166cf

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

source/tutorial/manage-sharded-cluster-balancer.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ the ``activeWindow``, as in the following:
105105
.. code-block:: javascript
106106

107107
use config
108-
db.settings.update({ _id : "balancer" }, { $unset : { activeWindow : true } })
108+
db.settings.updateOne( { _id : "balancer" }, { $unset : { activeWindow : true } } )
109109

110110
.. _sharding-balancing-disable-temporally:
111111
.. _sharding-balancing-disable-temporarily:
@@ -344,7 +344,7 @@ the following command:
344344
.. code-block:: javascript
345345

346346
use config
347-
db.settings.update(
347+
db.settings.updateOne(
348348
{ "_id" : "balancer" },
349349
{ $set : { "_secondaryThrottle" : { "w": "majority" } } },
350350
{ upsert : true }
@@ -391,7 +391,7 @@ change the balancer's ``_waitForDelete`` value:
391391
.. code-block:: javascript
392392

393393
use config
394-
db.settings.update(
394+
db.settings.updateOne(
395395
{ "_id" : "balancer" },
396396
{ $set : { "_waitForDelete" : true } },
397397
{ upsert : true }
@@ -408,7 +408,7 @@ Once set to ``true``, to revert to the default behavior:
408408
.. code-block:: javascript
409409

410410
use config
411-
db.settings.update(
411+
db.settings.updateOne(
412412
{ "_id" : "balancer", "_waitForDelete": true },
413413
{ $unset : { "_waitForDelete" : "" } }
414414
)

source/tutorial/model-monetary-data.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,16 +183,15 @@ The results of the aggregation pipeline can be verified using the
183183

184184
If you do not want to add a new field with the ``decimal`` value, the
185185
original field can be overwritten. The following
186-
:method:`~db.collection.update()` method first checks that ``price``
186+
:method:`~db.collection.updateMany()` method first checks that ``price``
187187
exists and that it is a ``long``, then transforms the ``long`` value to
188188
``decimal`` and stores it in the ``price`` field:
189189

190190
.. code-block:: javascript
191191

192-
db.clothes.update(
192+
db.clothes.updateMany(
193193
{ price: { $type: "long" } },
194-
{ $mul: { price: NumberDecimal( "0.01" ) } },
195-
{ multi: 1 }
194+
{ $mul: { price: NumberDecimal( "0.01" ) } }
196195
)
197196

198197
The results can be verified using the ``db.clothes.find()`` query:

source/tutorial/schedule-backup-window-for-sharded-clusters.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ chunk migrations affect the content of the backup captured by the
2525
backup procedure. Using the procedure outlined in the section
2626
:ref:`sharding-balancing-disable-temporarily` you can manually stop the
2727
balancer process temporarily. As an alternative, you can
28-
use the following procedure to define a balancing window so that the balancer
29-
is always disabled during your automated backup operation.
28+
use the following procedure to define a balancing window so that the
29+
balancer is always disabled during your automated backup operation.
3030

3131
.. tip::
3232

@@ -42,11 +42,16 @@ following command:
4242
.. code-block:: javascript
4343

4444
use config
45-
db.settings.update( { _id : "balancer" }, { $set : { activeWindow : { start : "06:00", stop : "23:00" } } }, true )
45+
db.settings.updateOne(
46+
{ _id : "balancer" },
47+
{ $set : { activeWindow : { start : "06:00", stop : "23:00" } } },
48+
true
49+
)
4650

4751
This operation configures the balancer to run between 6:00am and
4852
11:00pm, server time. Schedule your backup operation to run *and
4953
complete* outside of this time. Ensure that the backup can complete
5054
outside the window when the balancer is running *and* that the
5155
balancer can effectively balance the collection among the shards
5256
in the window allotted to each.
57+

0 commit comments

Comments
 (0)