Last active
August 29, 2015 14:02
-
-
Save mikermcneil/3550c86b72c7c4f58912 to your computer and use it in GitHub Desktop.
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
// Count all records | |
(function (){async.each(Object.keys(sails.models), function(mi, n) { var m = sails.models[mi]; m.count({}).exec(function(err, c) { if (err) return n(err); console.log('there are ' + c + ' ' + m.identity + ' records.'); }) }, console.log)})() | |
// Expanded version, for reference | |
//async.each(Object.keys(sails.models), function(mi, n) { | |
// var m = sails.models[mi]; | |
// m.count({}).exec(function(err, c) { | |
// if (err) return n(err); | |
// console.log('there are ' + c + ' ' + m.identity + ' records.'); | |
// }) | |
//}, console.log) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment