Skip to content
Closed
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions source/reference/method/MongoDBDatabase-createCollection.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,32 @@ Parameters

.. versionadded:: 1.9

* - flags
- integer
- Available for the MMAPv1 storage engine only to set the ``usePowerOf2Sizes`` and
``noPadding`` flags.

The library provides constants that you can combine with a
:php:`bitwise OR operator <language.operators.bitwise>` to set the flag
values:

- ``MongoDB\Operation\CreateCollection::USE_POWER_OF_2_SIZES``: ``1``
- ``MongoDB\Operation\CreateCollection::NO_PADDING``: ``2``

Defaults to ``1``.

MongoDB 3.0 and later ignores the ``usePowerOf2Sizes`` flag. See
:manual:`collMod </reference/command/collMod>` and
:manual:`db.createCollection()
</reference/method/db.createCollection>` for more information.

*Deprecated as of v1.21*: This option is deprecated, as the MMAPv1 storage
engine has been deprecated since {+mdb-server+} v4.2. The option will be removed in
{+php-library+} v2.0. For more information on upgrading from the MMAPv1 storage
engine to Wired Tiger, see the
:manual:`Change a Self-Managed Standalone to WiredTiger </tutorial/change-standalone-wiredtiger/>`
guide.

* - indexOptionDefaults
- array|object
- Allows users to specify a default configuration for indexes when
Expand Down