Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[week4] 실천과제 #8

Merged
merged 5 commits into from
May 27, 2022
Merged

[week4] 실천과제 #8

merged 5 commits into from
May 27, 2022

Conversation

hujumee
Copy link
Contributor

@hujumee hujumee commented May 26, 2022

What I learned

  • aws ec2 연결 및 무중단 배포
  • aws s3 버킷 생성
  • api 실습
    • express-validator를 통해 req로 들어온 값을 검증해줄 수 있음
    • 다른 컬렉션의 document 아이디를 참조한 경우 populate()를 통해 해당 document의 value를 가져올 수 있음

Note

  • schema를 생성할 때 mongoose.Types.ObjectId는 다른 객체(document)의 아이디를 뜻한다.
  • mongoose.model로 모델을 생성해줄 때 대문자(ex. "User")로 모델명을 지정하면,
    populate 함수를 실행할 때 MissingSchemaError가 발생한다.
    (소문자로 지정해주니 괜찮았음)

@hujumee hujumee added the 1️⃣ 실천과제 label May 26, 2022
@hujumee hujumee self-assigned this May 26, 2022
@hujumee hujumee merged commit 8a6c92d into main May 27, 2022
@hujumee hujumee added the ADD 새로운 내용 추가 label Jun 1, 2022
@Seokyeong237
Copy link
Member

대문자로 모델명을 지정하면, populate 함수를 실행 시 MissingSchemaError가 발생하는군요...!! 새로운 사실 알고 갑니다👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ADD 새로운 내용 추가 1️⃣ 실천과제
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants