From 03a36f97ed9d1c35788ebde55a67a2a36fb540a8 Mon Sep 17 00:00:00 2001 From: Alison Huh <112565127+ajhuh-mdb@users.noreply.github.com> Date: Wed, 20 Mar 2024 12:03:44 -0400 Subject: [PATCH] DOCSP-37727 dryRun Flag (#6813) * DOCSP-37727 dryRun Flag * typos * JD feedback * * --- source/includes/fact-compact-dryrun.rst | 4 ++++ source/reference/command/compact.txt | 20 ++++++++++++++------ source/release-notes/8.0.txt | 11 ++++++++++- 3 files changed, 28 insertions(+), 7 deletions(-) create mode 100644 source/includes/fact-compact-dryrun.rst diff --git a/source/includes/fact-compact-dryrun.rst b/source/includes/fact-compact-dryrun.rst new file mode 100644 index 00000000000..ee7823133b5 --- /dev/null +++ b/source/includes/fact-compact-dryrun.rst @@ -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. diff --git a/source/reference/command/compact.txt b/source/reference/command/compact.txt index 57609b7f94c..14814fb0114 100644 --- a/source/reference/command/compact.txt +++ b/source/reference/command/compact.txt @@ -29,7 +29,8 @@ The command has the following syntax: db.runCommand( { compact: , - force: , // Optional + dryRun: , + force: , // Optional freeSpaceTargetMB: , // Optional comment: , // Optional } @@ -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 diff --git a/source/release-notes/8.0.txt b/source/release-notes/8.0.txt index 94e066d17af..f2a4d912093 100644 --- a/source/release-notes/8.0.txt +++ b/source/release-notes/8.0.txt @@ -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 ~~~~~~~~~~~~~~~~~~~~~~