@@ -15,11 +15,11 @@ collMod
15
15
16
16
.. code-block:: javascript
17
17
18
- db.runCommand( {"collMod" : [ collection] , "[ flag] " : [ value]" } )
18
+ db.runCommand( {"collMod" : < collection> , "< flag> " : < value> } )
19
19
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.
23
23
24
24
.. index:: document; space allocation
25
25
.. index:: usePowerOf2Sizes
@@ -38,11 +38,29 @@ collMod
38
38
will be inserting and deleting large numbers of documents to
39
39
ensure that MongoDB will effectively use space on disk.
40
40
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.
46
64
47
65
:collflag:`usePowerOf2Sizes` only affects subsequent
48
66
allocations cased by document insertion or record relocation
@@ -51,6 +69,6 @@ collMod
51
69
52
70
.. Commenting out the following after DOCS-717, it does take
53
71
a lock but its to cover a very small metadata change.
54
-
72
+
55
73
This command obtains a write lock on the affected database
56
74
and will block other operations until it has completed.
0 commit comments