Docs Menu
Docs Home
/ / /
PHP Library Manual
/ / /

MongoDB\Model\CollectionInfo::isCapped()

On this page

  • Definition
  • Return Values
  • Examples
  • See Also

Deprecated since version 1.9.

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.

This method is deprecated in favor of using MongoDB\Model\CollectionInfo::getOptions() and accessing the capped key.

<?php
$info = new CollectionInfo([
'name' => 'foo',
'options' => [
'capped' => true,
'size' => 1048576,
]
]);
var_dump($info->isCapped());

The output would then resemble:

bool(true)

Back

getType()