バージョン1.9 以降では非推奨。
定義
Return Values
上限付きコレクション のサイズ制限(バイト単位)。 コレクションに上限が設けられていない場合は、 nullが返されます。
このメソッドは非推奨となり、代わりにMongoDB\Model\CollectionInfo::getOptions()を使用し、 sizeキーにアクセスします。
例
$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 collection foreach ($db->listCollections(['filter' => ['name' => 'myCappedCollection']]) as $info) { var_dump($info->getCappedSize()); }
出力は次のようになります。
int(1048576)
その他の参照
MongoDB マニュアルの「 Capped コレクション」
MongoDB マニュアルのlistCollectionsコマンド参照