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.
Examples
$db = (new MongoDB\Client)->test;
// Creates a capped collection with a document limit of 100$db->createCollection( 'myCappedCollection', ['capped' => true, 'size' => 1048576, 'max' => 100]);
// Retrieves the document limit for the capped collectionforeach ($db->listCollections(['filter' => ['name' => 'myCappedCollection']]) as $info) { 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