Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
MajorBook - Team202
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LeeYongJae
MajorBook - Team202
Commits
4ab73f80
Commit
4ab73f80
authored
5 years ago
by
YongJae
Browse files
Options
Downloads
Patches
Plain Diff
Add model - user.js (MongoDB)
parent
4f68aed5
No related branches found
Branches containing commit
No related tags found
1 merge request
!6
Login 기능 추가
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
backend/models/user.js
+17
-0
17 additions, 0 deletions
backend/models/user.js
with
17 additions
and
0 deletions
backend/models/user.js
0 → 100644
+
17
−
0
View file @
4ab73f80
var
mongoose
=
require
(
'
mongoose
'
);
var
Schema
=
mongoose
.
Schema
;
var
userSchema
=
new
Schema
({
user
:
String
,
name
:
String
,
id
:
String
,
password
:
String
,
email
:
String
,
isLoggedIn
:
Boolean
,
create_date
:
{
type
:
Date
,
default
:
Date
.
now
}
});
// model을 user로 만들면 특별한 이름을 지정하지 않으면
// mongoDB에서 알아서 Collection name을 알아서 복수형으로 해줍니다
// 그리하여 Collection name은 users로 됩니다
module
.
exports
=
mongoose
.
model
(
'
user
'
,
userSchema
);
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment