September 2017
Intermediate to advanced
450 pages
11h 24m
English
Let's follow these steps to add a User model to our application with secure password handling:
var mongoose = require('mongoose');var Schema = mongoose.Schema;var userSchema = new Schema({ firstName: String, lastName: String, email: { type: String, unique: true, required: true }, password: { type: String, required: true }, role: String,});module.exports = mongoose.model('user', userSchema);
Read now
Unlock full access