Skip to content

Commit 91d6839

Browse files
author
Sam Kleinman
committed
merge: DOCS-841
2 parents fe37eb6 + 808677f commit 91d6839

File tree

1 file changed

+28
-10
lines changed

1 file changed

+28
-10
lines changed

source/reference/command/collMod.txt

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ collMod
1515

1616
.. code-block:: javascript
1717

18-
db.runCommand( {"collMod" : [collection] , "[flag]" : [value]" } )
18+
db.runCommand( {"collMod" : <collection> , "<flag>" : <value> } )
1919

20-
In this command substitute ``[collection]`` with the name of the
21-
collection, and ``[flag]`` and ``[value]`` with the flag and value
22-
you want to set.
20+
In this command substitute ``<collection>`` with the name of a
21+
collection in the current database, and ``<flag>`` and ``<value>``
22+
with the flag and value you want to set.
2323

2424
.. index:: document; space allocation
2525
.. index:: usePowerOf2Sizes
@@ -38,11 +38,29 @@ collMod
3838
will be inserting and deleting large numbers of documents to
3939
ensure that MongoDB will effectively use space on disk.
4040

41-
.. note::
42-
.. versionchanged:: 2.2.1
43-
If you're using :collflag:`usePowerOf2Sizes`, ensure
44-
you use at least 2.2.1 to avoid the issue described in
45-
:issue:`SERVER-7238`.
41+
.. example::
42+
43+
To enable :collflag:`usePowerOf2Sizes` on the collection
44+
named ``sensor_readings``, use the following operation:
45+
46+
.. code-block:: javascript
47+
48+
db.runCommand({collMod: "sensor_readings", usePowerOf2Sizes:true })
49+
50+
To disable :collflag:`usePowerOf2Sizes` on the collection
51+
``products``, use the following operation:
52+
53+
.. code-block:: javascript
54+
55+
db.runCommand( { collMod: "products", "usePowerOf2Sizes": false })
56+
57+
58+
.. warning::
59+
.. versionchanged:: 2.2.1
60+
:collflag:`usePowerOf2Sizes` now
61+
supports documents larger than 8 megabytes. If you enable
62+
:collflag:`usePowerOf2Sizes` you **must** use at least
63+
version 2.2.1.
4664

4765
:collflag:`usePowerOf2Sizes` only affects subsequent
4866
allocations cased by document insertion or record relocation
@@ -51,6 +69,6 @@ collMod
5169

5270
.. Commenting out the following after DOCS-717, it does take
5371
a lock but its to cover a very small metadata change.
54-
72+
5573
This command obtains a write lock on the affected database
5674
and will block other operations until it has completed.

0 commit comments

Comments
 (0)