Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var userSchema = mongoose.Schema({
- local : {
- email : String,
- password : String,
- }
- });
- userSchema.methods.validPassword = function(password) {
- user=this;
- return this.local.password; <---------------THIS LINE
- };
- module.exports = mongoose.model('User', userSchema);
- var User = require('./usermodel.js);
- var objectUser = {
- email: "a2@a.com",
- password: "a222"
- };
- console.log(objectUser.User.validPassword());
- db.find({email: "a2@a.com"}).....
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement