1.17 版本中的新增功能。
定义
MongoDB\Collection::dropSearchIndex()删除集合的MongoDB Search索引。
function dropSearchIndex(string $name, array $options = []): void 此命令只能在托管在 MongoDB Atlas上的部署上运行,并且需要至少 M 10的 Atlas 集群层。 本地 Atlas 部署也可用于开发。
参数
$name: 细绳- 要删除的索引的名称。
$options: array指定所需选项的数组。
错误/异常
MongoDB\Exception\UnsupportedException,如果所选服务器使用了选项但不支持选项(例如collation、readConcern、writeConcern)。
MongoDB\Exception\InvalidArgumentException 用于与参数或选项解析相关的错误。
MongoDB\ 驱动程序\Exception\RuntimeException 用于扩展级别的其他错误(例如连接错误)。