Last active
July 6, 2016 02:58
-
-
Save RavenZZ/1641e4d721073e4a5bcbeb83880d834a to your computer and use it in GitHub Desktop.
Drop All Mongodb Indexes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use taskcenter | |
var collections = db.getCollectionNames() | |
collections.forEach((tableName)=>{ | |
if(tableName !=="system.profile"){ | |
print(`db.${tableName}.dropIndexes()`); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
执行结果