This document outlines the database schemas used in the Entertainment App for managing movies, TV shows, and user data.
- Purpose: Defines the structure for storing movie data.
- Collection: Movies
- Required Fields:
title
: Stringlanguage
: StringreleaseDate
: Datesummary
: Stringcast
: Array of Strings
- Optional Fields:
imdbId
: Stringrating
: Numberruntime
: Numberstatus
: Stringgenres
: Array of Stringshomepage
: StringbannerUrl
: StringposterUrl
: StringtrailerUrl
: String
- Purpose: Defines the structure for storing TV show data.
- Collection: TV Shows
- Required Fields:
title
: Stringlanguage
: StringfirstAirDate
: Datesummary
: String
- Optional Fields:
imdbId
: Stringrating
: Numberrated
: StringlastAirDate
: Datestatus
: Stringgenres
: Array of Stringscast
: Array of Stringshomepage
: StringbannerUrl
: StringposterUrl
: String
- Purpose: Manages user authentication and stores user-specific data.
- Collection: Users
- Fields:
email
: String (required)password
: String (required)watchlist
: Array of ObjectIds (references Movies and TV Shows)
- Features:
timestamps
: Automatically manages creation and update timestamps.
- User to Movies/TV Shows: A user can have multiple movies and TV shows in their watchlist, representing a one-to-many relationship.
- Function:
mongoose.model()
is used to create models based on the defined schemas, which interact with the database.