map을 통해서 array에 있는 값들을 지정한 것들로 묶어줄 수 있다.
hashtags.split(",").map((word)=> `#${word})
mongo console로 db를 확인할 수 있다.
show dbs use jutube show collections db.videos.find({}) db.videos.remove({})
Video.create()로 data를 mongo db에 저장할 수 있다.
Video.js에서 schema들에게 default, required, maxlength 등을 설정해줄 수 있다.
Video.js에서 minlength와 maxlength를 설정했을 경우 해당 html templates(node js에서는 pug)에서도 똑같이 minlength와 maxlength input을 설정해주어야 한다.
html template에 input을 설정하면 browser에서도 도와주기 때문에 오류를 줄일 수 있다.
(Regular Expression Exercise)
링크텍스트
(Regular Expression document)
링크텍스트
(New operator)
링크텍스트
(RegExp() constructor)
링크텍스트