Definición
MongoDB\Model\CollectionInfo::getCappedSize()Devuelve el límite de tamaño para la colección con tamaño fijo en bytes. Esto se correlaciona con la opción
sizeparaMongoDB\Database::createCollection().function getCappedSize(): integer|null
Return Values
El límite de tamaño para la colección con tamaño fijo en bytes. Si la colección no es limitada, se devolverá null.
Ejemplos
$db = (new MongoDB\Client)->test;
// Creates a capped collection with a size of 1048576$db->createCollection( 'myCappedCollection', ['capped' => true, 'size' => 1048576]);
// Retrieves the size limit for the capped collectionforeach ($db->listCollections(['filter' => ['name' => 'myCappedCollection']]) as $info) { var_dump($info->getCappedSize());}La vista de salida se ilustraría como sigue:
int(1048576)Ver también
colección con tamaño fijo en el manual de MongoDB
Referencia del comando listCollections en el manual de MongoDB