본 글은 글쓴이가 꺼내보기 위함의 목적이 큰 글입니다 :)
username:{
type: String
,trim: true // 공백제거
,unique:true
}
email:{
type: String,
index: true
}
username:{
type: String
,trim: true // 공백제거
,unique:true
,required: true
}
email:{
type: String,
index: true,
match: /.+\@.+@..+/
}
password:{
type: String,
validate:[
function(password){
return password.length >= 8;
}
'Password should be longer'
]
}
https://alexband.tistory.com/24?category=664373
https://poiemaweb.com/mongoose