diff --git a/.ext/mongodb_domain.py b/.ext/mongodb_domain.py index 934dc27483a..575b86aa72b 100644 --- a/.ext/mongodb_domain.py +++ b/.ext/mongodb_domain.py @@ -141,6 +141,10 @@ def run(self): names=('fields', 'fields', 'field', 'field'), typerolename=('dbcommand', 'setting', 'status', 'stats', 'aggregator'), typenames=('fieldtype', 'type')), + TypedField('flags', label=l_('Flags'), + names=('flags', 'flags', 'flag', 'flag'), + typerolename=('dbcommand', 'setting', 'status', 'stats', 'aggregator'), + typenames=('flagtype', 'type')), GroupedField('errors', label=l_('Throws'), rolename='err', names=('throws', ), can_collapse=True), diff --git a/source/reference/collection-statistics.txt b/source/reference/collection-statistics.txt index 465ffb8fb9e..02e46185c30 100644 --- a/source/reference/collection-statistics.txt +++ b/source/reference/collection-statistics.txt @@ -102,9 +102,31 @@ Fields .. stats:: flags - Indicates the number of flags on the current collection. At the - preset, the only flag notes the existence of an :term:`index` on - the :term:`_id` field. + .. versionchanged:: 2.2 + Removed in version 2.2 and replaced with the :stats:`userFlags` + and :stats:`systemFlags` fields. + + Indicates the number of flags on the current collection. In version + 2.0, the only flag notes the existence of an :term:`index` on the + :term:`_id` field. + +.. stats:: systemFlags + + .. versionadded:: 2.2 + + Reports the number of flags on this collection that reflect + internal server activity. Typically this value is ``1`` and + reflects the existence of an :term:`index` on the ``_id`` field. + +.. stats:: userFlags + + .. versionadded:: 2.2 + + Reports the total number of flags on this collection that reflect + user actions. In version 2.2 the only user collection flag is + ``usePowerOf2Sizes``. See :dbcommand:`collMod`` for more + information on setting user flags and :ref:`usePowerOf2Sizes + `. .. stats:: totalIndexSize diff --git a/source/reference/commands.txt b/source/reference/commands.txt index 6ffdb95a8df..09648715c33 100644 --- a/source/reference/commands.txt +++ b/source/reference/commands.txt @@ -1212,6 +1212,37 @@ Collections - It is not possible to compact :term:`capped collections `. +.. dbcommand:: collMod + + .. versionadded:: 2.2 + + :dbcommand:`collMod` makes it possible to add flags to a collection + to modify the behavior of MongoDB. In the current release the only + available flag is ``usePowerof2Sizes``. The command takes the + following prototype form: + + .. code-block:: javascript + + db.runCommand( {"collMod" : [collection] , "[flag]" : [value]" } ) + + In this command substitute ``[collection]`` with the name of the + collection, and ``[flag]`` and ``[value]`` with the flag and value + you want to set. + + .. index:: usePowerOf2Sizes + .. _usePowerOf2Sizes: + + The ``usePowerOf2Sizes`` flag changes the method that MongoDB uses + to allocate space on disk for documents in this collection. By + setting ``usePowerOf2Sizes``, you ensure that MongoDB will + allocates space for documents in sizes that are powers of 2 + (e.g. 4, 8, 16, 32, 64, 128, 512...) With this option MongoDB will + be able to more effectively reuse space. + + ``usePowerOf2Sizes`` is useful for collection where you will be + inserting and deleting large numbers of documents to ensure that + MongoDB will effectively use space on disk. + Administration ~~~~~~~~~~~~~~