How do I get the main function returning the value of the 'collection' anonymous function after it has been executed?
function getStudentStatus(name, course, term){
MongoClient.connect(url, function(err, db){
if(err) throw err;
var db_instance = db.db('newdb');
db_instance.collection('students').findOne({}, function(err, res){
if(err) throw err;
console.log('[Mongo Database]: '+ res.name);
});
});
}