db.getSiblingDB('admin').runCommand({setParameter: 1, failIndexKeyTooLong: false})
use DB
db.getCollectionNames().forEach(function(collection) {
indexes = db[collection].getIndexes();
print("Indexes for " + collection + ":");
printjson(indexes);
});
db.COLLECTION.dropIndexes()
db.getCollectionNames().forEach(function(collection) {
print("Indexes for " + collection + ":");
db[collection].dropIndexes();
});
db.getCollectionNames().forEach(function(collName) { db.runCommand({dropIndexes: collName, index: "*"}); });
rake db:mongoid:create_indexes RAILS_ENV=production
db.COLLECTION.getIndexes()
db.getCollectionNames().forEach(function(collection){db[collection].reIndex()})