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