강의

멘토링

커뮤니티

Inflearn Community Q&A

thdwlgnsl1225's profile image
thdwlgnsl1225

asked

Create your own blog with React (MERN Stack)

(06) MongoDB Modeling(1)

ref부분이요..

Written on

·

167

0

comments: [
{
post_id: {
type: mongoose.Schema.Types.ObjectId,
ref: "posts",
},
comment_id: {
type: mongoose.Schema.Types.ObjectId,
ref: "comments",
},
},
],
posts: [
{
type: mongoose.Schema.Types.ObjectId,
ref: "posts",

},

위의 ref부분들은 참조인데

왜 s를 다 붙이나용?

s붙은건 없지 않나요?

const Post = mongoose.model('post'PostSchema);
const Comment = mongoose.model('comment'CommentSchema);

다 post, comment 로 내보낸 걸로 알고 있는데

왜 s를 붙이나요???

reactexpressnodejsbootstrapreduxmongodb

Answer 1

2

ssaple님의 프로필 이미지
ssaple
Instructor

지훈님 의견이 맞습니다. 저도 지금에야 버그를 발견했네요. 좋은 의견 감사합니다. 해당 부분은 수정하도록 하겠습니다. 

thdwlgnsl1225's profile image
thdwlgnsl1225

asked

Ask a question