In this video, Emmanuel Henri completes the PUT endpoint so you can start updating specific contacts from your database. Then he tests the endpoint using Postman and Robot.
- [Instructor] Now when we need to update our data,…we need to create a put end point,…and this is what we'll focus on in this video.…So go back into the controller files, so cmcontrol.js.…And what we'll do is create a new function again,…which will be similar to the other ones.…So cont and this one will be called UpdateContact.…So we're passing the request, response, and we're using…again the contact collection and the function that…we're going to use on this one is find one and update.…
So this one here.…So find one and update.…So if you're typing this manually,…make sure you get the spelling right.…Find one and update.…This is a function.…And this function requires a few things.…First, it requires an ID.…So which contact in your database that you want to update?…And we're passing this through the request params,…contact ID like we've done before.…Then what we need to do is pass the actual body…of the request so we can use it to create the new data.…
And then we have a few options that we're going to use.…So the next option is basically telling Mongo…
- 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
Node.js: Extend and Maintain Applicationswith Daniel Khan3h 35m Intermediate
Node.js: Build Your First Microservicewith Daniel Khan2h 9m 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?
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.