Skip to content

Tag: mongoose

update two layer nested object based on the id

I have this structure in my Mother Model (this is a fixed structure and I just push cards or update them on these 3 array levels): The Objects inside cards.advanced array above are like: Assuming I have access to Mother model like this: How can we update a card object based on its id and the level it belongs …

Node.js throws TypeError: Cannot destructure property ‘firstName’ of ‘req.body’ as it is undefined, even though it works for an other post request

So I know there are tons of similar questions out there, and I’ve read most of them in the past few days. However I didn’t find any solution to my problem. The app is about users can post memories(cards) etc… Point is, when I create a new card with POST request, there is no problem, but when…