バージョン 1.9 以降非推奨。
定義
MongoDB\Model\CollectionInfo::isCapped()
コレクションが Capped コレクションであるかどうかを返します。
function isCapped(): boolean
Return Values
コレクションが Capped コレクション かどうかを示すブール値。
このメソッドは非推奨となり、代わりに MongoDB\Model\CollectionInfo::getOptions()
を使用し、 capped
キーにアクセスします。
例
$db = (new MongoDB\Client)->test; // Creates a capped collection $db->createCollection( 'myCappedCollection', ['capped' => true, 'size' => 1048576] ); // Retrieves whether the collection is capped foreach ($db->listCollections(['filter' => ['name' => 'myCappedCollection']]) as $info) { var_dump($info->isCapped()); }
出力は次のようになります。
bool(true)
その他の参照
MongoDB マニュアルの「 Capped コレクション」
MongoDB マニュアルのlistCollectionsコマンド参照