发布于 2015-09-14 15:08:04 | 162 次阅读 | 评论: 0 | 来源: 网络整理

dropIndexes

The dropIndexes command drops one or all indexes from the current collection. To drop all indexes, issue the command like so:

{ dropIndexes: "collection", index: "*" }

To drop a single, issue the command by specifying the name of the index you want to drop. For example, to drop the index named age_1, use the following command:

{ dropIndexes: "collection", index: "age_1" }

The shell provides a useful command helper. Here’s the equivalent command:

db.collection.dropIndex("age_1");

警告

This command obtains a write lock on the affected database and will block other operations until it has completed.

最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务