From the course: Databases for Node.js Developers
Unlock this course with a free trial
Join today to access over 24,400 courses taught by industry experts.
Item administration: Create, update, and delete - Node.js Tutorial
From the course: Databases for Node.js Developers
Item administration: Create, update, and delete
- [Instructor] In the previous video, we connected our admin page to MongoDB to list all items and to load an item for editing. Now it's time to complete CRUD by creating, updating and deleting items in the database. After this video we'll have a fully functional admin panel where we can add new items, modify existing ones, and remove item from our database. Let's get started. We already have a form in our admin panel, but right now submitting it doesn't actually update the database. So let's update our route to either create a new item or update an existing one based on whether an item ID is provided. This is a very common pattern for database manipulation routes. So let's look into this in Visual Studio Code. And when I scroll down, here is this route. So it's a post route because we are submitting a form. And in line 15 we get the itemID, the sku, the name, and the price. And also what I not have here, please follow along. We also want to get the tags here. So also let's close this…
Contents
-
-
-
-
-
(Locked)
Managing product data with MongoDB33s
-
Setting up MongoDB with Docker2m 30s
-
(Locked)
Exploring MongoDB with Compass1m 19s
-
(Locked)
Introducing Mongoose2m 59s
-
(Locked)
Setting up Mongoose and connecting it to MongoDB10m 14s
-
(Locked)
Building a model for our products5m 25s
-
(Locked)
Integrating the model into our application3m 55s
-
(Locked)
Populating MongoDB with sample data2m 6s
-
(Locked)
Querying items with Mongoose9m 19s
-
(Locked)
Filtering items by tag4m 27s
-
(Locked)
Item administration: Listing and loading6m 32s
-
(Locked)
Item administration: Create, update, and delete15m 14s
-
(Locked)
Optimizing queries with indexes5m 33s
-
(Locked)
Performing text search in MongoDB5m 34s
-
(Locked)
-
-
-
-