In this video, Emmanuel Henri creates the MongoDB schema that supports your database you add new items to soon.
- [Instructor] Before we start adding operations…to our database and the corresponding end points,…we need to create our schema.…So let's go ahead and do this.…What you want to do is open the CRM model…in models folder, like so and…we'll start creating our schema.…So first, let's import mongoose from mongoose.…Then, let's create a Schema and it's a capital S by the way…from a mongoose.Schema, like so.…
And then, what we'll do is create…our schema and make sure we export it at the same time,…so this is a shortcut so you can do the export…after so, if I create the variable here,…so if I do const and then, let's create…the variable, ContactSchema and then…create a new schema like so.…This is the function and then all the schema stuff…will go in here and then you would…eventually do an export of the default, blah, blah, blah.…
But, the shorter way of doing this,…if you want to do it that way, if you have standards…or if you have best practices but then your company…want to follow them, then, do the export default here.…
- Setting up a project and a server
- Setting up a database and schema
- Creating POST, GET, PUT, and DELETE endpoints
- Serving files
Skill Level Intermediate
1. Setting Up
2. Initial Server Build
3. CRUD Operations
4. Other API Options
Static files serving3m 16s
Next steps1m 1s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.