mongodb drop all indexes code example
Example: drop all indexes mongodb
db.getCollectionNames().forEach(function(collName) {
db.runCommand({dropIndexes: collName, index: "*"});
});
db.getCollectionNames().forEach(function(collName) {
db.runCommand({dropIndexes: collName, index: "*"});
});