I am developing a web app using Codeigniter and MongoDB. The users can upload files and other users can comment on them.
I store the comments in an array called comm
I think, you have add mongodb id to each comment when insert it. You can create a new mongodb id like this;
$comment_id = new MongoID();
Now, you can delete comments by id with $pull + $update like @smoorthy's answer.