작성
·
431
2
수업내용대로 진행했고(cats에서 comments보여주기) 빌드시 에러는 뜨지 않지만 localhost:8000/cats/all을 출력하면 아래와 같은 메세지가 뜨면서 500에러가 납니다.
ERROR [ExceptionsHandler] Schema hasn't been registered for model "comments".
Use mongoose.model(name, schema)
강의에서는 mongodb compass에서 db name도 comments고 collection도 comments인데 저는 db name은 cats이고 이 안에 cats와 comments collection입니다. 혹시 이것 때문에 에러가 발생하는지 모르겠어요.
소스는 https://github.com/GroundP/CatsCommunity 입니다.
어떤 문제가 있을까요?
mongodb compass 접속시 정보
@nestcluster.qlg5b.mongodb.net/mmm?authSource=admin&replicaSet=atlas-pyw4q8-shard-0&readPreference=primary&appname=MongoDB%20Compass&ssl=true
소스에서 db접근시 정보
@nestcluster.qlg5b.mongodb.net/cats?retryWrites=true&w=majority"
이걸 말씀하시는걸까요?