Skip to content

Instantly share code, notes, and snippets.

@normgraham
Last active August 29, 2015 13:55
Show Gist options
  • Select an option

  • Save normgraham/8716714 to your computer and use it in GitHub Desktop.

Select an option

Save normgraham/8716714 to your computer and use it in GitHub Desktop.
Validate all collections in a database
var validateCollections = function(dbname) {
var vdb = db.getMongo().getDB(dbname);
vdb.getCollectionNames().forEach(function(coll) {
printjson(vdb[coll].validate(true));
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment