0
控制台语句从不打印。我不知道为什么。我正在写一个函数来列出所有字符(一个用户有很多字符)。该功能尚未完整编写。它只是返回用户指定的电子邮件。Mongo /回调函数和节点问题 - 从不调用回调
由于某种原因,但它永远不会返回。它输出“This statement prints”但从来没有“为什么不这样打印”声明!
UserSchema.methods.usersCharacters = function(email,cb){
User.findOne({'local.email' : email }).exec(function(err, user){
if (err) console.log("oops");
console.log("This statement prints");
return user;
});
};
UserSchema.methods.usersCharacters('[email protected]', function(err, okay){
console.log("Why doesn't this ever print?");
});