diff --git a/source/reference/command/collMod.txt b/source/reference/command/collMod.txt index e87838fc574..b83fb44e16b 100644 --- a/source/reference/command/collMod.txt +++ b/source/reference/command/collMod.txt @@ -15,11 +15,11 @@ collMod .. code-block:: javascript - db.runCommand( {"collMod" : [collection] , "[flag]" : [value]" } ) + db.runCommand( {"collMod" : , "" : } ) - In this command substitute ``[collection]`` with the name of the - collection, and ``[flag]`` and ``[value]`` with the flag and value - you want to set. + In this command substitute ```` with the name of a + collection in the current database, and ```` and ```` + with the flag and value you want to set. .. index:: document; space allocation .. index:: usePowerOf2Sizes @@ -38,6 +38,21 @@ collMod will be inserting and deleting large numbers of documents to ensure that MongoDB will effectively use space on disk. + .. example:: + + Enable :collflag:`usePowerOf2Sizes` on the collection `sensor_readings`: + + .. code-block:: javascript + + db.runCommand({collMod: "sensor_readings", usePowerOf2Sizes:true }) + + Disable :collflag:`usePowerOf2Sizes` on the collection `products`: + + .. code-block:: javascript + + db.runCommand( { collMod: "products", "usePowerOf2Sizes": false }) + + .. note:: .. versionchanged:: 2.2.1 If you're using :collflag:`usePowerOf2Sizes`, ensure @@ -51,6 +66,6 @@ collMod .. Commenting out the following after DOCS-717, it does take a lock but its to cover a very small metadata change. - + This command obtains a write lock on the affected database and will block other operations until it has completed.