I am trying to update a field in nested array object, but the field is not getting updated.
I need to update the comment field and I am using the below query to update it, using mongoose,
let updateComment = await StoryComment.update({ _id: this.req.body.commentId, 'comments.reply.userId': currentUser, 'comments.reply._id': this.req.body.replyId }, { $set:{ 'reply.$.comment': replyData } }, { new: true, 'safe': true, 'upsert': true });
can anyone help me to fix this issue, it looks right but its not getting updated
