I have a collection of posts
{
"uid": ObjectId("57e58f6a1ccbdd1407000029"),
"text": "Post content goes here!",
"comments": [
{
"_id": // unique ID
"comment": "Comment 1",
},
{
"_id": // unique ID
"comment": "Comment 2",
}
]
}
The above is a simple example of the post collection's document structure.
I was thinking that, what would be the best way to generate and store a unique id (using PHP) for each comment so that it could be selected specifically to edit or delete.