ANNOUNCEMENT: Voyage AI joins MongoDB to power more accurate and trustworthy AI applications on Atlas.
Learn more
Docs 菜单

MongoDB\Collection::dropSearchIndex()

1.17 版本中的新增功能

MongoDB\Collection::dropSearchIndex()

删除collection的 Atlas Search 搜索索引。

function dropSearchIndex(string $name, array $options = []): void

此命令只能在MongoDB Atlas上托管的部署上运行,并且需要至少 M 10的Atlas 集群层级。 本地Atlas部署也可用于开发。

$name : 细绳
要删除的索引的名称。
$options : array

指定所需选项的数组。

名称
类型
说明

comment

混合

使用户可以指定任意注释来帮助通过数据库分析器currentOp 输出和日志来跟踪操作。

MongoDB\Exception\UnsupportedException,如果所选服务器使用了选项但不支持选项(例如collationreadConcernwriteConcern)。

MongoDB\Exception\InvalidArgumentException表示与参数或选项解析相关的错误。

MongoDB\ 驱动程序\Exception\RuntimeException 对于扩展级别的其他错误(例如连接错误)。