drop all indexes on a collection mongodb 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: "*"});
});