MongooseJS Essentials - Learn MongoDB for Node.js

Learn how to create Mongoose Schemas to build a full CRUD application based on the MongoDB database design.
4.3 (582 ratings) Instead of using a simple lifetime average, Udemy calculates a
course's star rating by considering a number of different factors
such as the number of ratings, the age of ratings, and the
likelihood of fraudulent ratings.
11,244 students enrolled
Free
Start Learning Now
  • Lectures 8
  • Length 44 mins
  • Skill Level Beginner Level
  • Languages English
  • Includes Lifetime access
    30 day money back guarantee!
    Available on iOS and Android
    Certificate of Completion
Wishlisted Wishlist

How taking a course works

Discover

Find online courses made by experts from around the world.

Learn

Take your courses with you and learn anywhere, anytime.

Master

Learn and practice real-world skills and achieve your goals.

About This Course

Published 3/2016 English

Course Description

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

  • Build CRUD Applications
  • Create Mongoose Schemas
  • Design Routes using Express.js
  • Create a Server using Express.js
  • Build a RESTful API

What are the requirements?

  • You should already have Node.js installed
  • You should already have MongoDB installed

What am I going to get from this course?

  • Build CRUD Applications
  • Create Mongoose Schemas
  • Design Routes using Express.js
  • Create a Server using Express.js
  • Build a RESTful API
  • Use Postman

What is the target audience?

  • This course is intended for those who are already familiar with the basics of both Node.js and MongoDB. This includes an understanding of the CommonJS pattern of requiring in modules along with an understanding of simple data types defined within MongoDB.

What you get with this course?

Not for you? No problem.
30 day money back guarantee.

Forever yours.
Lifetime access.

Learn on the go.
Desktop, iOS and Android.

Get rewarded.
Certificate of completion.

Curriculum

Section 1: Introduction
01:55

Welcome to the course!

Section 2: Mongoose Overview
02:43

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.

05:45

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
13:42

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.

03:30

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.

08:05

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.

07:29

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
5 questions
Bonus Lecture
Article

Students Who Viewed This Course Also Viewed

  • Loading
  • Loading
  • Loading

Instructor Biography

Patrick Schroeder, Software Developer

Patrick Schroeder is a self-taught full stack JavaScript developer. He enjoys working with Angular, Node.js, Mongodb, React.js, Firebase, and anything else javascript related. Patrick is passionate about teaching Javascript. He loves to help others understand difficult concepts by creating clear presentations that gradually builds to full comprehension of a given topic. He is very interested in furthering his knowledge of IOT and wearable products with the intention of teaching cutting edge technologies and collaborating to bring new products to life. 

Ready to start learning?
Start Learning Now