File tree 3 files changed +28
-7
lines changed
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:
29
29
db.runCommand(
30
30
{
31
31
compact: <string>,
32
- force: <flag>, // Optional
32
+ dryRun: <boolean>,
33
+ force: <boolean>, // Optional
33
34
freeSpaceTargetMB: <int>, // Optional
34
35
comment: <any>, // Optional
35
36
}
@@ -52,16 +53,23 @@ The command takes the following fields:
52
53
- string
53
54
- The name of the collection.
54
55
56
+ * - ``dryRun``
57
+ - boolean
58
+ - .. versionadded:: 8.0
59
+
60
+ .. include:: /includes/fact-compact-dryrun.rst
61
+
62
+ *Default:* False
63
+
55
64
* - ``force``
56
- - flag
65
+ - boolean
57
66
- .. versionchanged:: 4.4
58
67
59
68
.. _compact-force-option:
60
69
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.
65
73
66
74
* - ``freeSpaceTargetMB``
67
75
- Integer
Original file line number Diff line number Diff line change @@ -17,14 +17,23 @@ Release Notes for MongoDB 8.0 (Release Candidate)
17
17
General Changes
18
18
---------------
19
19
20
+ Compaction Improvements
21
+ ~~~~~~~~~~~~~~~~~~~~~~~
22
+
20
23
Background Compaction
21
- ~~~~~~~~~~~~~~~~~~~~~
24
+ `````````````````````
22
25
23
26
Starting in MongoDB 8.0, you can use the new :dbcommand:`autoCompact` command
24
27
to perform background compaction. If enabled, the server attempts to keep free
25
28
space within each collection and index below the specified the
26
29
``freeSpaceTargetMB`` value.
27
30
31
+ dryRun Option
32
+ `````````````
33
+
34
+ .. include:: /includes/fact-compact-dryrun.rst
35
+
36
+
28
37
New Bulk Write Command
29
38
~~~~~~~~~~~~~~~~~~~~~~
30
39
You can’t perform that action at this time.
0 commit comments