Inflearn Community Q&A
this 대신 todoSchema 사용 시 에러 이유
Written on
·
193
0
안녕하세요,
제가 let user = this; 를 대신해서
위를 모두 가리키는 todoSchema 을 사용하였습니다.
todoSchema.isModified('password'))
todoSchema.password
todoSchema.password
postman 에서 post send 시 에러나와서요.ㅠ
혹시 제가 잘 못 사용했는지요? 아니면 다르게 사용해야 하나요?
reactnodejs
Answer 2
1
John Ahn
Instructor
this들어 있는 값은 user의 정보들이 들어있습니다 하지만 todoSchema를 console.log로 찍어보시면
훨씬 많은 정보들이 들어있고 this와는 다른 형식으로 들어있답니다.
그러기에 this를 쓰셔야지 this.password 이런식으로 접근이 가능합니다 ^^
0





