I have the below structure
{
"_id": {
"$oid": "55ae24016fb73f6ac7c2d640"
},
"Name": "some name",
"District": "some district",
"Stories": [
{
"userId": "105304831528398207103",
"story": "some story",
"Likes": ["user id 1" ..... ],
"_id": {
"$oid": "55c055af1875b0002572cf94"
}
}
]
}
So in this requirement there will be many stories, and userId is the id of the author who posted it. And there is a column called Likes, and I will add user id of user who likes the story. And I remove their id from Likes array when they unlike it.
What is a better model for this requirement? or is this model fine for storing likes?
Is it ok to use nested arrays in mongodb ?