Skip to content

Commit

Permalink
DOCSP-37727 dryRun Flag (#6813)
Browse files Browse the repository at this point in the history
* DOCSP-37727 dryRun Flag

* typos

* JD feedback

* *
  • Loading branch information
ajhuh-mdb authored Mar 20, 2024
1 parent 98b6177 commit 03a36f9
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
4 changes: 4 additions & 0 deletions source/includes/fact-compact-dryrun.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
If enabled, the ``compact`` command returns an estimate of how much space, in
bytes, compaction can reclaim from the targeted collection. If you run
``compact`` with ``dryRun`` set to ``true``, MongoDB only returns the estimated
value and does not perform any kind of compaction.
20 changes: 14 additions & 6 deletions source/reference/command/compact.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ The command has the following syntax:
db.runCommand(
{
compact: <string>,
force: <flag>, // Optional
dryRun: <boolean>,
force: <boolean>, // Optional
freeSpaceTargetMB: <int>, // Optional
comment: <any>, // Optional
}
Expand All @@ -52,16 +53,23 @@ The command takes the following fields:
- string
- The name of the collection.

* - ``dryRun``
- boolean
- .. versionadded:: 8.0

.. include:: /includes/fact-compact-dryrun.rst

*Default:* False

* - ``force``
- flag
- boolean
- .. versionchanged:: 4.4

.. _compact-force-option:

Optional. If specified, forces
``compact`` to run on the :term:`primary` in
a :term:`replica set`. ``compact`` does not block
:ref:`crud` on the database it is compacting.
Optional. If enabled, forces ``compact`` to run on the :term:`primary` in
a :term:`replica set`. ``compact`` does not block :ref:`crud` on the
database it is compacting.

* - ``freeSpaceTargetMB``
- Integer
Expand Down
11 changes: 10 additions & 1 deletion source/release-notes/8.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,23 @@ Release Notes for MongoDB 8.0 (Release Candidate)
General Changes
---------------

Compaction Improvements
~~~~~~~~~~~~~~~~~~~~~~~

Background Compaction
~~~~~~~~~~~~~~~~~~~~~
`````````````````````

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

dryRun Option
`````````````

.. include:: /includes/fact-compact-dryrun.rst


New Bulk Write Command
~~~~~~~~~~~~~~~~~~~~~~

Expand Down

0 comments on commit 03a36f9

Please sign in to comment.