-
Notifications
You must be signed in to change notification settings - Fork 1
/
User.js
50 lines (40 loc) · 804 Bytes
/
User.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
const mongoose =require('mongoose');
const emailObject = new mongoose.Schema({
userId:{
type: mongoose.Schema.Types.ObjectId,
ref:'User'
},
to:[String],
cc:[String],
subject:String,
schedule:String,
content:String,
time:Number
});
const userSchema = new mongoose.Schema({
email:{
type:String,
required : true,
max:255,
min: 6
},
name:{
type : String,
required : true,
min : 6,
max: 255
},
password:{
type:String,
required: true,
},
isverified:{
type:Boolean,
default:false
},
emailList:{
type:[emailObject],
required:false
}
}) ;
module.exports = mongoose.model('User',userSchema);