inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

알린이가젤좋아님의 게시글

알린이가젤좋아 알린이가젤좋아

@alinefanclub

수강평 작성수
1
평균평점
5.0

게시글 4

질문&답변

updateMany에서 user._id를 못찾는 상황

해결 const BlogSchema = new Schema( { title: { type: String, required: true }, content: { type: String, required: true }, islive: { type: Boolean, required: true, default: false }, user: { _id: { type: Object, required: true, ref: "user" }, username: { type: String, required: true }, name: { first: { type: String, required: true }, last: { type: String, required: true }, }, }, comments: [commentSchema], }, { timestamps: true } ); => const BlogSchema2 = new Schema( { title: { type: String, required: true }, content: { type: String, required: true }, islive: { type: Boolean, required: true, default: false }, user: { _id: { type: Types.ObjectId, required: true, ref: "user" }, username: { type: String, required: true }, name: { first: { type: String, required: true }, last: { type: String, required: true }, }, }, commentsCount: { type: Number, default: 0, required: true }, comments: [commentSchema], }, { timestamps: true } ); 바보같이 user type을 object로 해서 생긴 문제.....

좋아요수
1
댓글수
1
조회수
424

질문&답변

todolist에 propsdata를 this.$store.state.todoItems로 변경시켜줬더니 페이지에 아무것도 뜨지않습니다

TodoList.vue 에서 store에서 가져온 값으로 변경을 해주었기때문에 app.vue 안에 메소드 부분도 변경을 시켜줘야 합니다! addTodoItem (todoItems) { var obj = {completed: false , item: todoItems}; localStorage. setItem (todoItems, JSON. stringify (obj)); this.$store.state.todoList. push (obj); },

좋아요수
1
댓글수
5
조회수
579