hy0 / models /User.js
no1b4me's picture
Rename models/user.js to models/User.js
16f6d2c verified
raw
history blame
394 Bytes
const mongoose = require('mongoose');
// Define the schema for the User model
const userSchema = new mongoose.Schema({
email: {
type: String,
required: true,
unique: true
},
password: {
type: String,
required: true
}
});
// Create the User model using the schema
const User = mongoose.model('User', userSchema);
module.exports = User;