Mongoose Schem-nastics
This is a review of how to create a mongoose schema, link it to a database and create basic CRUD methods.
- Create an express server that has one Mongoose Schema for olympians.
- Mongoose should connect to a new database called
olympics
. - The schema should be called
olympian
(remember mongoose will pluralize this automatically) have name, sport, country, age, gender, and medal (array) properties. - Use Express Router to to create a get all, get one by ID, and a post route for the olympian schema.
Use postman to add at least 5 olympians to your database and to test your routes