wetube 6.15 ~ 6.19

이주왕·2022년 2월 27일
0

Node Js

목록 보기
7/10

Map()

map을 통해서 array에 있는 값들을 지정한 것들로 묶어줄 수 있다.

hashtags.split(",").map((word)=> `#${word})

Mongo Console

mongo console로 db를 확인할 수 있다.

show dbs
use jutube
show collections
db.videos.find({})
db.videos.remove({})

Video.create()

Video.create()로 data를 mongo db에 저장할 수 있다.

Video.js Schema

Video.js에서 schema들에게 default, required, maxlength 등을 설정해줄 수 있다.
Video.js에서 minlength와 maxlength를 설정했을 경우 해당 html templates(node js에서는 pug)에서도 똑같이 minlength와 maxlength input을 설정해주어야 한다.
html template에 input을 설정하면 browser에서도 도와주기 때문에 오류를 줄일 수 있다.

Regular Expression

(Regular Expression Exercise)
링크텍스트

(Regular Expression document)
링크텍스트

(New operator)
링크텍스트

(RegExp() constructor)
링크텍스트

profile
Learn more

0개의 댓글

관련 채용 정보