Answer the question
In order to leave comments, you need to log in
How to bind mongodb and class in Node.js?
I have a 'User' model like this:
User=new Schema({
'login':string,
'firstName':string,
'lastName':string
})
User.findOne({'login':'peterjacobs123'}, function(err, user){
//...error handle...
console.log(user.firstName);
})
var user = new User('peterjacobs123');
console.log(user.firstName);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question