I’m new to NoSQL and am trying to model likes and dislikes.
I’ve made an attempt with some messy thoughts, but I’m not sure if I’m doing it correctly.
(1)
{
"posts": {
"post1":{
"id": "jmvv4e",
"content": "Hello",
"timestamp": 312421000,
"likes_number": 1,
"likes": {
"like1": {
"uid": "udfad2",
"timestamp": 312421241
}
}
}
}
}
(2)
{
"posts:":{
"post1":{
"id": "jmvv4e",
"content": "Hello",
"timestamp": 312421000
}
},
"likes": {
"likes1": {
"post_id": "jmvv4e",
"uid": "udfad2",
"timestamp": 312421241
}
}
}
I’m using (1) right now. Should I separate nested “likes” within “posts” as shown in (2)?