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