Check out a free preview of the full API Design in Node.js (using Express & Mongo) course:
The "Exercise 8" Lesson is part of the full, API Design in Node.js (using Express & Mongo) course featured in this preview video. Here's what you'd learn in this lesson:

In this exercise, you will design schemas for the category, post, and user models in the application.

Get Unlimited Access Now

Transcript from the "Exercise 8" Lesson

>> [MUSIC]

>> Speaker 1: There's a lot of fun stuff going in step eight. So we got rid of the db tester file because that was just a one off file that we were using to test the database. And now, if you go to step eight and you look in the api folder on each resource there's a respective model file.

[00:00:19] And we have to go ahead and design these schemas. Everything else is set up for you as far as the exports. All you have to do is just fill out the actual schemas, the blueprint for these models.
>> Speaker 1: All right. So any questions there? That's all we have to do.

[00:00:44] So, as far as what they look like, again, the blueprint is in the JSON right here.
>> Speaker 1: So you can infer what types they are, as far as how to use the types, here's an example of here how to use the different types.
>> Speaker 1: And that's what we gotta do for those models, so.