• 카테고리

    질문 & 답변
  • 세부 분야

    풀스택

  • 해결 여부

    미해결

ref부분이요..

20.09.30 15:16 작성 조회수 106

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를 붙이나요???

답변 1

답변을 작성해보세요.

2

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