개발/Node.js2024. 11. 5. 14:48Delete and Search Video

1. Delete Video - 삭제는 template, controller, router 모두 사용해야 됨 - findOneAndDelete와 findOneAndRemove의 차이   - mongoose api에도 나와있지만 웬만하면 findOneAndDelete를 사용하면 된다고 나와있음   - 근데 findByIdAndDelete는 findOneAndDelete({ _id: id })를 줄인 것이므로 findByIdAndDelete 사용   - https://github.com/Daniel-Jeon/wetube-loaded/commit/79eb465f1ee8d6347536ca6c4e444c0b310ad2a9 Delete Video !! · Daniel-Jeon/wetube-loaded@79eb465..

개발/Node.js2024. 11. 4. 15:53More Schema, Router 수정

1. More Schema - https://mongoosejs.com/docs/schematypes.html Mongoose v8.8.0: SchemaTypesSchemaTypes handle definition of path defaults, validation, getters, setters, field selection defaults for queries, and other general characteristics for Mongoose document properties. You can think of a Mongoose schema as the configuration object for a Monmongoosejs.com// upload.pugextends baseblock content..

전반적인 Router 구성하기
개발/Node.js2024. 10. 25. 15:40전반적인 Router 구성하기

1. Route Tree - 사용자의 마인드가 되어 웹사이트이 구조를 어떻게 만들지를 구상해야 함 - globalRouter에 login search Router 만들기# Global/ -> Home/join - Join/login -> Login/search -> Search# User/user/:id -> See profile/user/logout -> Log out/user/edit -> Edit my profile/user/delete -> Delete my profile# Videos/videos/:id - > See watch video in my channel/videos/:id/edit -> Edit video/videos/:id/delete -> Delete video/videos/up..

image