For at gøre dette via Mongoose-modellen til samlingen, kan du ringe til dropAllIndexes af den oprindelige samling:
MyModel.collection.dropAllIndexes(function (err, results) {
// Handle errors
});
Opdater
dropAllIndexes er forældet i 2.x-versionen af den oprindelige driver, så dropIndexes skal bruges i stedet:
MyModel.collection.dropIndexes(function (err, results) {
// Handle errors
});