how the server recognizes the title
and description
from the front-end? : it's from the post method form and each input of it!
how the filename
and path
automatically defined? : multer!
how the shape of this wonderful data information made? : schema in the Video.js ! mongoose.model("Video", videoSchema)
.
this is real question haha.. how the newVideo.id
made? I know it is same as the filename, but I can't understand where it came from. Is the id just the one of it's object, by default?
1.It is because of the 'name' on the input html.
2. multer
3. yes
4.newVideo.id is created automatically for you by Mongo, mongo creates super random and unique ids.