File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -302,11 +302,12 @@ Remove All Orphaned Documents from a Shard
302302:dbcommand:`cleanupOrphaned` examines documents from a single
303303contiguous range of shard keys. To remove all orphaned documents from
304304the shard, you can run :dbcommand:`cleanupOrphaned` in a loop, using
305- the returned ``stoppedAtKey`` as the next ``startingFromKey``, as in
306- the following:
305+ the returned ``stoppedAtKey`` as the next ``startingFromKey``, as shown in
306+ the following example :
307307
308308.. code-block:: javascript
309309
310+ var loopSleep = 100;
310311 var nextKey = { };
311312 var result;
312313
@@ -319,6 +320,10 @@ the following:
319320 printjson(result);
320321
321322 nextKey = result.stoppedAtKey;
323+
324+ if (loopSleep > 0) sleep(loopSleep);
322325 }
323326
327+ print("Orphan cleanup complete.");
328+
324329.. admin-only
You can’t perform that action at this time.
0 commit comments