Created
September 3, 2013 17:43
-
-
Save dafyddcrosby/6427098 to your computer and use it in GitHub Desktop.
Validate all collections in MongoDB
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
conn = new Mongo(); | |
dblist = conn.getDBs(); | |
dblist.databases.forEach(function(x){ | |
db = db.getSiblingDB(x.name); | |
db.getCollectionNames().forEach(function(c){ | |
printjson(db.getCollection(c).validate()) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment