Last active
February 7, 2017 02:17
-
-
Save cristopher-rodrigues/a0d7f540f4fcf19758eb to your computer and use it in GitHub Desktop.
list all indexes on database (mongo)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.getCollectionNames().forEach(function(collection) { | |
indexes = db[collection].getIndexes(); | |
print("Indexes for " + collection + ":"); | |
printjson(indexes); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment