Find online courses made by experts from around the world.
Take your courses with you and learn anywhere, anytime.
Learn and practice real-world skills and achieve your goals.
In this course we will build a simple application to show how to perform full CRUD (create, read, update, delete) operations within Node.js.
We'll be using the Node module MongooseJS. Mongoose allows us to define our models in the form of a schema, along with a simple to use API that abstracts away a lot of the pain of working directly with the MongoDB driver.
First, we will create a Book schema using MongooseJS. We will use string data types to add a title, author and description. Next, we will build a simple server using Express.js. Then we will build 4 routes to query, update and delete Books from our Schema. We will use Postman to perform actions on these routes and check the results in our browser.
What You Will Learn
Not for you? No problem.
30 day money back guarantee.
Learn on the go.
Desktop, iOS and Android.
Certificate of completion.
|Section 1: Introduction|
Welcome to the course!
|Section 2: Mongoose Overview|
This video covers the basics of what Mongoose is and how we use it.
Mongoose provides a straight-forward, schema-based solution to model your application data. It includes built-in type casting, validation, query building, business logic hooks and more, out of the box.
In this video we learn how to create a Mongoose Schema. Then we'll discuss the different data types and how to export a Mongoose Model so its available to use in other files.
|Section 3: Build a CRUD Application|
Start building our mini-app that will be able to perform create, read, update and delete operations.
We'll be using a Mongoose Book-Schema along with Express to query objects and display results.
Learn how to use the findOne() method to retrieve just one book.
How to use the req.params method for retrieving a single book
And how to create a single book route that accepts a /:id parameter to grab a single book that corresponds to our _id Model.
This video will cover how to create new Books using the POST method. We'll be using Postman to demonstrate how to how to add a new Book to our model.
This video will cover how to update and delete Books using the findOneAndUpdate method and the remove method. We'll be using Postman to demonstrate how to how to update and delete a Book.
First we'll find() a book passing in the _id parameter for the book, then we'll update or delete this book.
Test Your Knowledge