第五章 MongoDb索引优化 5.6

7.删除索引 

a.删除某个表中的所有索引 
To delete all indexes on the specified collection:
命令行:db.collection.dropIndexes();
java:coll.dropIndex("rsc");
b.删除某个表中的单一索引 
To delete a single index:
db.schedule.dropIndex({rsc:1});
> db.runCommand(db.schedule.dropIndex({rsc:1}));
{
        "errmsg" : "no such cmd",
        "bad cmd" : {
                "nIndexesWas" : 2,
                "ok" : 1
        },
        "ok" : 0
}
延伸阅读:
http://www.mongodb.org/display/DOCS/Indexes#Indexes-DocumentsasKeys
http://www.mongodb.org/display/DOCS/min+and+max+Query+Specifiers
http://www.mongodb.org/display/DOCS/Advanced+Queries


本文转自jooben 51CTO博客,原文链接:http://blog.51cto.com/jooben/365919
上一篇:【MongoDB学习笔记25】MongoDB的索引类型


下一篇:解读InnoDB页面--索引结构