Created
January 30, 2014 19:28
-
-
Save normgraham/8716876 to your computer and use it in GitHub Desktop.
Print all the indexes on all the databases on a replica set member
This file contains hidden or 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
| var printAllIndexes = function() { | |
| rs.slaveOk() | |
| db.adminCommand({"listDatabases":1}).databases.forEach(function(doc){ | |
| print(doc.name); | |
| db.getSiblingDB(doc.name).system.indexes.find().sort({ns:1,name:1}).forEach(printjson); | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment