Skip to content

Instantly share code, notes, and snippets.

@robertwalsh0
Created March 11, 2014 16:33
Show Gist options
  • Save robertwalsh0/9489494 to your computer and use it in GitHub Desktop.
Save robertwalsh0/9489494 to your computer and use it in GitHub Desktop.
var allBlogs = function(cb){
Blog.find({}, function(err, docs){
if(err){
cb(err, null);
}
else{
cb(null, docs);
}
});
};
// give the create functions enough time to run
// before returning list of all blogs
setTimeout(function(){
allBlogs(function(err, docs){
console.log(docs);
});
}, 3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment