Created
March 11, 2014 16:33
-
-
Save robertwalsh0/9489494 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
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