mongodbdrop all indexes on a table 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: "*"});
});