Navigation
This version of the documentation is archived and no longer supported. To learn how to upgrade your version of PHP Library Manual, refer to the upgrade documentation.

MongoDB\Model\CollectionInfo::getOptions()

Definition

MongoDB\Model\CollectionInfo::getOptions

Return the collection options. This correlates with the options for MongoDB\Database::createCollection(), but may include additional fields set by the server.

function getOptions(): array

Return Values

The collection options.

Examples

<?php

$info = new CollectionInfo([
    'name' => 'foo',
    'options' => [
        'capped' => true,
        'size' => 1048576,
    ]
]);

var_dump($info->getOptions());

The output would then resemble:

array(2) {
  ["capped"]=>
  bool(true)
  ["size"]=>
  int(1048576)
}

See Also