Skip to content

Commit a879ae6

Browse files
authored
user model
1 parent bb951d7 commit a879ae6

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

models/User.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,27 @@
11

2+
const mongoose = require('mongoose');
3+
const Schema = mongoose.Schema;
4+
5+
//Create Schema
6+
const UserSchema = new Schema({
7+
googleID:{
8+
type:String,
9+
required: true
10+
},
11+
email:{
12+
type: String,
13+
required: true
14+
},
15+
firstName: {
16+
type: String
17+
},
18+
lastName: {
19+
type: String
20+
},
21+
image: {
22+
type: String
23+
}
24+
});
25+
26+
//Create collection and add schema
27+
mongoose.model('users', UserSchema);

0 commit comments

Comments
 (0)