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

MongoDB\Model\CollectionInfo::getOptions()

MongoDB\Model\CollectionInfo::getOptions()

返回collection选项。这与MongoDB\Database::createCollection()的选项相关,但可能包括服务器设置的其他字段。

function getOptions(): array

collection选项。这对应于listCollections命令回复中返回的options字段。

<?php
// Creates a capped collection
$db->createCollection(
'myCappedCollection',
['capped' => true, 'size' => 1048576]
);
// Retrieves the options for the collection
foreach ($db->listCollections(['filter' => ['name' => 'myCappedCollection']]) as $info) {
var_dump($info->getOptions());
}

而输出将类似如下所示:

array(2) {
["capped"]=>
bool(true)
["size"]=>
int(1048576)
}