I want to store user specific data in mongodb. For example: User creates an account with email id and password and stores his favorite movie names with genre and year. one user can have many movie names stored like this. example
{
"email":"contact@proboticslab.com",
"password":"something",
"movies":[
{
"name":"avatar",
"genre":"action",
"year":"2012"
},
{
"name":"black panther",
"genre":"action",
"year":"2018"
},
{
"name":"ironman",
"genre":"action",
"year":"2016"
}
]
}
so my question is, is it a right way to store data in such manner or should I follow different patter? There will be more users not just one. please explain me with example if possible. I am new to mongo db. Thank you.