对于 AI 代理:可在 https://www.mongodb.com/zh-cn/docs/llms.txt 获取文档索引—通过在任何 URL 路径后添加 .md 可获取所有页面的 Markdown 版本。

MongoDB\Model\CollectionInfo::getCappedSize()

MongoDB\Model\CollectionInfo::getCappedSize()

返回固定大小集合的大小限制(以字节为单位)。 这与MongoDB\Database::createCollection()的size选项相关。

function getCappedSize(): integer|null

固定大小集合的大小限制(以字节为单位)。 如果collection未设定上限,则返回null 。

<?php $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 collectionforeach ($db->listCollections(['filter' => ['name' => 'myCappedCollection']]) as $info) { var_dump($info->getCappedSize());}

而输出将类似如下所示:

int(1048576)
给本页内容打分