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.
31 lines
500 B
JavaScript
31 lines
500 B
JavaScript
const mongoose = require("mongoose");
|
|
|
|
|
|
const userSchema = new mongoose.Schema({
|
|
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; |