강의

멘토링

커뮤니티

Inflearn Community Q&A

m1nq's profile image
m1nq

asked

Solid backend NestJS, from basics to advanced

Cat Data Create Read API Development

CREATE API 관련 질문입니다!

Written on

·

193

0

강의 내용에서, POST body로부터 받아온 JSON 데이터를 바로 Cat 배열에 push하는 식으로 진행이 되는데 { "A": 123 } 식의 임의의 형태도 문제 없이 삽입이 되는 것 같습니다.

타 언어에 익숙하여 그런지, 이 부분이 잘 이해가 되지 않아 질문을 드립니다.

1. app.model에서 type CatType 으로 미리 정의해둔 프로퍼티를 지키지 않아도 CatType의 변수가 될 수 있는건가요 ...?  js 의 자유도가 익숙치 않은 것 같습니다...ㅜㅜ

2. 해당 상황이 문법 상 문제가 없다면, property에 대한 validation은 보통 어떻게 진행되나요?

nodejsexpressmongodbNestJSssr

Answer

This question is waiting for answers
Be the first to answer!
m1nq's profile image
m1nq

asked

Ask a question