For AI agents: a documentation index is available at https://www.mongodb.com/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.

MongoDB\Model\CollectionInfo::isCapped()

MongoDB\Model\CollectionInfo::isCapped()

Return whether the collection is a capped collection.

function isCapped(): boolean

A boolean indicating whether the collection is a capped collection.

<?php $db = (new MongoDB\Client)->test; // Creates a capped collection$db->createCollection( 'myCappedCollection', ['capped' => true, 'size' => 1048576]); // Retrieves whether the collection is cappedforeach ($db->listCollections(['filter' => ['name' => 'myCappedCollection']]) as $info) { var_dump($info->isCapped());}

The output would then resemble:

bool(true)