Skip to content

Commit 56524f0

Browse files
author
Sam Kleinman
committed
DOCS-267 power of two sizes documentation
1 parent 6a20e38 commit 56524f0

File tree

2 files changed

+56
-3
lines changed

2 files changed

+56
-3
lines changed

source/reference/collection-statistics.txt

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,31 @@ Fields
102102

103103
.. stats:: flags
104104

105-
Indicates the number of flags on the current collection. At the
106-
preset, the only flag notes the existence of an :term:`index` on
107-
the :term:`_id` field.
105+
.. versionchanged:: 2.2
106+
Removed in version 2.2 and replaced with the :stats:`userFlags`
107+
and :stats:`systemFlags` fields.
108+
109+
Indicates the number of flags on the current collection. In version
110+
2.0, the only flag notes the existence of an :term:`index` on the
111+
:term:`_id` field.
112+
113+
.. stats:: systemFlags
114+
115+
.. versionadded:: 2.2
116+
117+
Reports the number of flags on this collection that reflect
118+
internal server activity. Typically this value is ``1`` and
119+
reflects the existence of an :term:`index` on the ``_id`` field.
120+
121+
.. stats:: userFlags
122+
123+
.. versionadded:: 2.2
124+
125+
Reports the total number of flags on this collection that reflect
126+
user actions. In version 2.2 the only user collection flag is
127+
``usePowerOf2Sizes``. See :dbcommand:`collMod`` for more
128+
information on setting user flags and :ref:`usePowerOf2Sizes
129+
<usePowerOf2Sizes>`.
108130

109131
.. stats:: totalIndexSize
110132

source/reference/commands.txt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,6 +1212,37 @@ Collections
12121212
- It is not possible to compact :term:`capped collections <capped
12131213
collection>`.
12141214

1215+
.. dbcommand:: collMod
1216+
1217+
.. versionadded:: 2.2
1218+
1219+
:dbcommand:`collMod` makes it possible to add flags to a collection
1220+
to modify the behavior of MongoDB. In the current release the only
1221+
available flag is ``usePowerof2Sizes``. The command takes the
1222+
following prototype form:
1223+
1224+
.. code-block:: javascript
1225+
1226+
db.runCommand( {"collMod" : [collection] , "[flag]" : [value]" } )
1227+
1228+
In this command substitute ``[collection]`` with the name of the
1229+
collection, and ``[flag]`` and ``[value]`` with the flag and value
1230+
you want to set.
1231+
1232+
.. index:: usePowerOf2Sizes
1233+
.. _usePowerOf2Sizes:
1234+
1235+
The ``usePowerOf2Sizes`` flag changes the method that MongoDB uses
1236+
to allocate space on disk for documents in this collection. By
1237+
setting ``usePowerOf2Sizes``, you ensure that MongoDB will
1238+
allocates space for documents in sizes that are powers of 2
1239+
(e.g. 4, 8, 16, 32, 64, 128, 512...) With this option MongoDB will
1240+
be able to more effectively reuse space.
1241+
1242+
``usePowerOf2Sizes`` is useful for collection where you will be
1243+
inserting and deleting large numbers of documents to ensure that
1244+
MongoDB will effectively use space on disk.
1245+
12151246
Administration
12161247
~~~~~~~~~~~~~~
12171248

0 commit comments

Comments
 (0)