Skip to content

Added videogame and genre models#5

Open
LucasFeli wants to merge 1 commit into
DelfiSamperi:mainfrom
LucasFeli:Mongo
Open

Added videogame and genre models#5
LucasFeli wants to merge 1 commit into
DelfiSamperi:mainfrom
LucasFeli:Mongo

Conversation

@LucasFeli

Copy link
Copy Markdown

Added Videogame and Genre Models
I have added the following models based on the provided specifications:

Model 1: Videogame
This model represents a video game with the following fields:

ID: Automatically generated by MongoDB.
Name (required): The name of the video game.
Description (required): A description of the video game.
Platforms (required): An array of strings representing the platforms on which the game is available.
Image (required): A URL for the game's image.
Release Date (required): The release date of the video game.
Rating (required): A numeric value representing the game's rating.
Genres (optional): An array of ObjectId references to the Genre model, simulating a many-to-many relationship.
Model 2: Genre
This model represents a genre with the following fields:

ID: Automatically generated by MongoDB.
Name (required): The name of the genre.

These models use Mongoose and simulate a many-to-many relationship between Videogame and Genre by referencing the Genre model in the Videogame model.

Let me know if you have any feedback or suggestions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant