0
I am creating a streaming application similar to Netflix and would like to know what would be the best way to treat "relationships" in Mongo. (I don’t know if using a bank in the QTS is the best option, but I don’t care, it’s only for matters of study even...).
When it comes to posting movies, it’s quiet. Just create in a model, but when it comes to series(Breaking bad, Friends etc.) what would be the best way? since a series has several episodes and these in turn will probably have to have an ID for every time the user clicks one of them to be redirected to the tab with the ID of that episode. My question is the following: it is better to create a new MODEL for each episode posted (I believe it is not the best way, since that way would end up having several models and if it was a large application would become unviable). Or is it ideal to have an array type field inside the model of each series posted? Example:
serieSchema = new mongoose.Schema({
title: String,
episodes: Array
)}
this way I see more sense, but I can’t think of how I would pass an ID for each new episode posted.I’m sorry if I got confused, I appreciate anyone who can help me with the reasoning.
Thank you so much for your help and for providing the source :)
– Regex