You are viewing an offline version of MongoDB documentation. Some page features might be unavailable. To view the latest version of the page or use interactive features, visit the live page.
MongoDB\Model\CollectionInfo::getCappedMax()
Deprecated since version 1.9.
Definition
MongoDB\Model\CollectionInfo::getCappedMax()Return the document limit for the capped collection. This correlates with the
maxoption forMongoDB\Database::createCollection().function getCappedMax(): integer|null
Return Values
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.
Examples
$info = new CollectionInfo([ 'name' => 'foo', 'options' => [ 'capped' => true, 'size' => 1048576, 'max' => 100, ] ]); var_dump($info->getCappedMax());
The output would then resemble:
int(100)
See Also
Capped Collections in the MongoDB manual
listCollections command reference in the MongoDB manual