File tree Expand file tree Collapse file tree 3 files changed +28
-7
lines changed Expand file tree Collapse file tree 3 files changed +28
-7
lines changed Original file line number Diff line number Diff line change 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.
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -17,14 +17,23 @@ Release Notes for MongoDB 8.0 (Release Candidate)
1717General Changes
1818---------------
1919
20+ Compaction Improvements
21+ ~~~~~~~~~~~~~~~~~~~~~~~
22+
2023Background Compaction
21- ~~~~~~~~~~~~~~~~~~~~~
24+ `````````````````````
2225
2326Starting in MongoDB 8.0, you can use the new :dbcommand:`autoCompact` command
2427to perform background compaction. If enabled, the server attempts to keep free
2528space 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+
2837New Bulk Write Command
2938~~~~~~~~~~~~~~~~~~~~~~
3039
You can’t perform that action at this time.
0 commit comments