코드를 쭉 확인해보니까 addToFavorite을 눌러서 몽고db에 추가를 할때 runtime이 db에 저장이 안되는거 같은데요
router.post('/addToFavorite', (req,res) => {
console.log(req.body)
const favorite = new Favorite(req.body);
console.log(favorite)
favorite.save((err,doc) => {
if(err) return res.status(400).send(err);
return res.status(200).json({success:true, doc})
})
})
req.body:
{ movieId: '602223', userFrom: '60f6908e5da3b93ee0080c1c', movieTitle: 'The Forever Purge', moviePost: '/tehpKMsls621GT9WUQie2Ft6LmP.jpg', movieRuntime: 103 }여기서는 런타임을 받아오는데
favorite:
{
_id: 60fac8252363cd3448230525,
movieId: '602223',
userFrom: 60f6908e5da3b93ee0080c1c,
movieTitle: 'The Forever Purge',
moviePost: '/tehpKMsls621GT9WUQie2Ft6LmP.jpg'
}favorite에서는 런타임이 없습니다. 뭐가 문제인가요