Problem is - i can't define variable inside this function (console.log is working), and can't find another way how to get _id from this damn model.
User.findOne({name: name}, function(err, user) {
var test = user._id;
console.log(user._id);
});
via Сергей Иванов
No comments:
Post a Comment