For my comments it was pretty easy …
return await PostModel.findByIdAndUpdate(
post_ID,
{
$addToSet: {
comments: {
creatorId: req.body.creatorId,
creator: req.body.creator,
body: req.body.body,
likes: [],
replies: [],
timestamp: new Date().getTime(),
},
},
},
{ new: true },
(err, docs) => {
if (!err) return res.send({ docs });
else return res.status(400).send(err);
}
);
I wanna do the same with my replies , but I cant access it ![]()