Skip to content

Commit 03a36f9

Browse files
authored
DOCSP-37727 dryRun Flag (#6813)
* DOCSP-37727 dryRun Flag * typos * JD feedback * *
1 parent 98b6177 commit 03a36f9

File tree

3 files changed

+28
-7
lines changed

3 files changed

+28
-7
lines changed
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
If enabled, the ``compact`` command returns an estimate of how much space, in
2+
bytes, compaction can reclaim from the targeted collection. If you run
3+
``compact`` with ``dryRun`` set to ``true``, MongoDB only returns the estimated
4+
value and does not perform any kind of compaction.

source/reference/command/compact.txt

+14-6
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ The command has the following syntax:
2929
db.runCommand(
3030
{
3131
compact: <string>,
32-
force: <flag>, // Optional
32+
dryRun: <boolean>,
33+
force: <boolean>, // Optional
3334
freeSpaceTargetMB: <int>, // Optional
3435
comment: <any>, // Optional
3536
}
@@ -52,16 +53,23 @@ The command takes the following fields:
5253
- string
5354
- The name of the collection.
5455

56+
* - ``dryRun``
57+
- boolean
58+
- .. versionadded:: 8.0
59+
60+
.. include:: /includes/fact-compact-dryrun.rst
61+
62+
*Default:* False
63+
5564
* - ``force``
56-
- flag
65+
- boolean
5766
- .. versionchanged:: 4.4
5867

5968
.. _compact-force-option:
6069

61-
Optional. If specified, forces
62-
``compact`` to run on the :term:`primary` in
63-
a :term:`replica set`. ``compact`` does not block
64-
:ref:`crud` on the database it is compacting.
70+
Optional. If enabled, forces ``compact`` to run on the :term:`primary` in
71+
a :term:`replica set`. ``compact`` does not block :ref:`crud` on the
72+
database it is compacting.
6573

6674
* - ``freeSpaceTargetMB``
6775
- Integer

source/release-notes/8.0.txt

+10-1
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,23 @@ Release Notes for MongoDB 8.0 (Release Candidate)
1717
General Changes
1818
---------------
1919

20+
Compaction Improvements
21+
~~~~~~~~~~~~~~~~~~~~~~~
22+
2023
Background Compaction
21-
~~~~~~~~~~~~~~~~~~~~~
24+
`````````````````````
2225

2326
Starting in MongoDB 8.0, you can use the new :dbcommand:`autoCompact` command
2427
to perform background compaction. If enabled, the server attempts to keep free
2528
space within each collection and index below the specified the
2629
``freeSpaceTargetMB`` value.
2730

31+
dryRun Option
32+
`````````````
33+
34+
.. include:: /includes/fact-compact-dryrun.rst
35+
36+
2837
New Bulk Write Command
2938
~~~~~~~~~~~~~~~~~~~~~~
3039

0 commit comments

Comments
 (0)