Skip to content
Snippets Groups Projects
Commit 4ab73f80 authored by YongJae's avatar YongJae
Browse files

Add model - user.js (MongoDB)

parent 4f68aed5
No related branches found
No related tags found
1 merge request!6Login 기능 추가
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment