Toggle navigation
Toggle navigation
This project
Loading...
Sign in
정승호
/
Hexa_for_you_renewal
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
정승호
2020-05-21 22:43:11 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9d3d9dec69d473cd01870cf4c8ff656b6874069f
9d3d9dec
1 parent
04aba57b
user login model added
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
models/Users.js
models/Users.js
0 → 100644
View file @
9d3d9de
const
mongoose
=
require
(
'mongoose'
);
const
userSchema
=
mongoose
.
Schema
({
name
:
{
type
:
String
,
maxlength
:
50
},
email
:{
type
:
String
,
trim
:
true
,
// trim은 이메일 주소 받을때 공백을 없애준다.
unique
:
1
// 중복 허용 안함
},
password
:{
type
:
String
,
minlength
:
50
},
lastname
:{
type
:
String
,
maxlength
:
50
},
role
:{
type
:
Number
,
// 1 : admin, 0 : common user
default
:
0
},
image
:
String
,
token
:
{
type
:
String
},
tokenExp
:{
type
:
Number
,
}
})
const
User
=
mongoose
.
model
(
'User'
,
userSchema
)
model
.
exports
=
{}
Please
register
or
login
to post a comment