In this video, learn how to wire up a database service module with your routes.
- [Instructor] An item management system…usually has to support three basic operations,…Create, update, and delete.…In short, CrUD.…If you look into server routes,…admin, item, and into the file index.js,…as you see, we have already plenty…of business logic here implemented already,…it's just commented out yet.…And I will start now by uncommenting that,…and first let's remove this return statement…from this get route.…
That's an index route that will list…all items to us, or it can also fetch…an individual item if it gets an item ID here…at this optional param.…So I remove the comments here,…and here as well.…And ESLint complains that next is not defined,…and we have to add it here to the callback.…
Next we also have to require the item service,…so up here on line two I add…const itemService…equals…require.…And we have to go a few levels up,…so one, two,…three,…and here in services I require itemService.…
That looks good so far.…So we see that we have to implement…a function itemService.getAll,…and we have to implement one itemService.getOne.…
- Basics of relational and nonrelational databases
- Preparing your environment
- When to use document databases
- Inserting data into MongoDB
- Basic insert operations for MongoDB
- Querying data from MongoDB with Node.js
- Using key-value stores
- Using relational databases with Node.js
- Adding MySQL and Sequelize to a project
Skill Level Intermediate
1. Get Started with Databases for Node.js
2. Prepare Your Environment
3. Use Document Databases with Node.js
4. Use Key-Value Stores with Node.js
5. Use Relational Databases with Node.js
- 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.