You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
const mongoose = require("mongoose");
|
|
|
|
|
|
|
|
|
|
|
|
const userSchema = new mongoose.Schema({
|
|
|
|
firstName: {
|
|
|
|
type: String,
|
|
|
|
required: [true, 'First Name is Required']
|
|
|
|
},
|
|
|
|
lastName: {
|
|
|
|
type: String,
|
|
|
|
required: [true, 'Last Name is Required']
|
|
|
|
},
|
|
|
|
email: {
|
|
|
|
type: String,
|
|
|
|
required: [true, "Email is required!"]
|
|
|
|
},
|
|
|
|
password: {
|
|
|
|
type: String,
|
|
|
|
required: [true, "Password is required!"]
|
|
|
|
},
|
|
|
|
mobileNo: {
|
|
|
|
type: String,
|
|
|
|
required: [true, 'Mobile Number is Required']
|
|
|
|
},
|
|
|
|
isAdmin: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
},
|
|
|
|
orders: {
|
|
|
|
type: Array
|
|
|
|
},
|
|
|
|
myCart: {
|
|
|
|
type: Array
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
const User = mongoose.model("users", userSchema);
|
|
|
|
|
|
|
|
module.exports = User;
|