[MUSIC]
Time to move on to the second assignment in this course.
In this module we have been working with MongoDB and Mongoose.
We have seen how we can use Mongoose to set up the schema and the model for
a document, and also set up the Mongoose ODM to be able to
interact with our MongoDB database in the back end.
We have also learned how we would be able to update the REST API
server in order to interact with the MongoDB database,
we specifically did that with the end part.
In the second assignment we will complete the implementation of the REST API
express router that we have built up in this course.
So in the second assignment we will have two tasks to be completed.
The first task in the second assignment is to build up the schema and the model for
the promotions which will be supported by other x plus router.
An example of a promotion document is given to you here, and
also given to you in the assignment instructions, so
this promotion document will contain several fields as shown there.
You need to implement the corresponding Mongoose schema and
Mongoose model, and thereafter you will be using this
mongoose schema and the model in your promoRouter.js file.
Recall that the promoRouter.js file is the one that supports the /promotions and
the /promotions/promoId in parts.
So you'll be updating the promo router to access the MongoDB database,
using Mongoose to interact with the database to support the get,
put, post, and delete operations on the REST API endpoints.
So that would be the first task in this assignment,
at the end of this task of course you will be able to save
a promotion to your database and retrieve the promotion, update,
and delete promotions using the get, put, post, and delete operations.
Your second task in this assignment is to obviously
implement the leaders schema in the model.
An example of the leaders document is given here, and
also in the assignment instructions.
So the leader document contains several fields,
you need to implement the corresponding Mongoose schema and
the model to support all these different fields.
Thereafter, you will be using the Mongoose schema and
model in your leaderRouter.js file, and
support the get, put, post, and delete operations on that /leaders and
the /leaders/currentleaderId REST API in parts,
just like the way you did with the promotions and the promo router.
So once you complete updating both the promotions and
the leaders support, including the REST API endpoint support,
then your Express REST API server will be almost ready for
serving up all the data that is required by your planned application.
Have fun completing the second assignment in this course.
[MUSIC]