I have ExpressJS ,NodeJs, Mongoose application. I have written mongodb code like below and it works fine.
module.exports.getStudentid = function(id, callback) {
Student
.find({ _id: id })
.populate('marks')
.exec(callback);
}
But is it a good code in terms of error handling in NodeJS..Will it pass error to the next layer? How can I improve the above code to use proper error handling?
via Jocket
No comments:
Post a Comment