Skip to content

Commit 788acd4

Browse files
authored
DOCS-12938 Add Key Check Confirmation and Sleep (#2508)
1 parent b9ab438 commit 788acd4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

source/reference/command/cleanupOrphaned.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,11 +302,12 @@ Remove All Orphaned Documents from a Shard
302302
:dbcommand:`cleanupOrphaned` examines documents from a single
303303
contiguous range of shard keys. To remove all orphaned documents from
304304
the 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

0 commit comments

Comments
 (0)