Docs Menu

Docs HomePHP Library Manual


On this page

  • Definition
  • Return Values
  • Examples
  • See Also

Deprecated since version 1.9.


Return the document limit for the capped collection. This correlates with the max option for MongoDB\Database::createCollection().

function getCappedMax(): integer|null

The document limit for the capped collection. If the collection is not capped, null will be returned.

This method is deprecated in favor of using MongoDB\Model\CollectionInfo::getOptions() and accessing the max key.

$info = new CollectionInfo([
'name' => 'foo',
'options' => [
'capped' => true,
'size' => 1048576,
'max' => 100,

The output would then resemble:

  • MongoDB\Model\CollectionInfo::getCappedSize()

  • MongoDB\Model\CollectionInfo::isCapped()

  • MongoDB\Database::createCollection()

  • Capped Collections in the MongoDB manual

  • listCollections command reference in the MongoDB manual

←  MongoDB\Model\CollectionInfo ClassMongoDB\Model\CollectionInfo::getCappedSize() →