1.17版本新增。:
定义
MongoDB\Collection::dropSearchIndex()删除集合的MongoDB搜索索引。
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 用于扩展级别的其他错误(例如连接错误)。
另请参阅
MongoDB 手册中的dropSearchIndex命令参考