drop index

用于删除集合中的索引。

语法

drop index <index_name> on <cs_name>.<cl_name>

参数

参数名参数类型描述是否必填
index_namestring索引名。
cs_namestring集合名。
cl_namestring集合名。

返回值

无。

示例

  • 删除集合 sample.employee 中名为 “test_index” 的索引。

    1. // 等价于 db.sample.employee.dropIndex("test_index")
    2. > db.execUpdate("drop index test_index on sample.employee")
    3. Takes 0.4693s.