const mongoose = require(‘mongoose’);
const userSchema = new mongoose.Schema({
username: {
type: String,
// required: true,
// unique: true
},
email: {
type: String,
// required: true,
// unique: true
},
password: {
type: String,
},
firstname: {
type: String,
},
lastname: {
type: String,
},
address: {
type: String,
},
mobile: {
type: String,
},
age: {
type: Number,
},
gender: {
type: String,
},
userType: {
type: String,
},
versionKey: false //here
},{
versionKey: false //here
});
const User = mongoose.model(‘User’, userSchema);
module.exports = User;