7.删除索引
To delete all indexes on the specified collection:
命令行:db.collection.dropIndexes();
java:coll.dropIndex("rsc");
b.删除某个表中的单一索引
To delete a single index:
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