-
카테고리
-
세부 분야
풀스택
-
해결 여부
미해결
Schema hasn't been registered for model "comment".
21.09.19 05:31 작성 조회수 284
1
Schema hasn't been registered for model "comment".
혹시 이 문제 생기시는분 /server/models/post.js 파일 위쪽에
require('./comments') 해주시면 될거예요
인터넷에 찾아보니 포스트모델은 코멘트라는 모델을 참조하고 있기 때문에 몽고스 모델 스키마 저장해줘야되는데 그냥 불러와 진다고 생각하고 안 참조해서 생긴 에러라고 하네요!
요기서 그렇게 설명하네요
https://saegeullee.github.io/nodejs/mongoose-error-schema-hasnt-been-registered
답변을 작성해보세요.
답변 2