This is my Code:
Server is starting successfully, without syntactical errors
tried searching for bugs, but couldnt find anything, changed name of models, tried restarting IDE and POSTMAN
i think the correct method name is findByIdAndUpdate as follows
const updatedPost = await Post.findByIdAndUpdate(
post,
{ $push: { comments: savedComment._id } },
{ new: true }
)
you might need to capitalize the 'a' in 'and' as it is not recognized