1.17版本新增。
定义
MongoDB\Collection::dropSearchIndex()删除集合的MongoDB搜索索引。
function dropSearchIndex(string $name, array $options = []): void This command can only be run on a deployment hosted on MongoDB Atlas and requires an Atlas cluster tier of at least M10. A Local Atlas Deployment can also be used for development.
参数
$name: 细绳- 要删除的索引的名称。
$options: array指定所需选项的数组。
错误/异常
MongoDB\Exception\UnsupportedException,如果所选服务器使用了选项但不支持选项(例如collation、readConcern、writeConcern)。
MongoDB\Exception\InvalidArgumentException 用于与参数或选项解析相关的错误。
MongoDB\ 驱动程序\Exception\RuntimeException 用于扩展级别的其他错误(例如连接错误)。
另请参阅
MongoDB 手册中的dropSearchIndex命令参考
MongoDB Search documentation in the MongoDB Manual