Closed dm67x closed 8 years ago
I use recently ORM package to manage my database. I made this on app.js :
app.use(orm.express("mysql://........", { define: function(db, models, next) { models.user = db.define("user", { nom: String, prenom: String, addr_mail: String, mdp: String, num_telephone: Number, points: Number }); next(); } }));
But when I use req.models.user.find({addr_mail: req.body.mail}, function....) on my routes/users.js it always return undefined.
I think the problem comes from me.
I use recently ORM package to manage my database. I made this on app.js :
app.use(orm.express("mysql://........", { define: function(db, models, next) { models.user = db.define("user", { nom: String, prenom: String, addr_mail: String, mdp: String, num_telephone: Number, points: Number }); next(); } }));
But when I use req.models.user.find({addr_mail: req.body.mail}, function....) on my routes/users.js it always return undefined.
I think the problem comes from me.