In this last day of tutorial, we are going to talk about how we can integrate an nosql database with the node js.
If we use mongodb as a no-sql database, which is really really popular. We can use a package call mongoose
Check out the mongoose official document https://mongoosejs.com/
Installing is pretty easy. Just putting npm install mongoose will done the work. You can write npm i mongoose too.
After requiring the mongoose using const mongoose = require('mongoose') we just need to put the database name on the connection
Like this
We can easily find the schema in the mongoose official page
In the time on making live project, you can use mlab for the hosting mongodb.
So are you confident enough that you can read & understand some node js code right now ?
You can see the graphical version here
Originally it published on nerdjfpbblog. You can connect with me in twitter or linkedin !
You can read the old posts from this series (below)
![nerdjfpb](https://res.cloudinary.com/practicaldev/image/fetch/s--gdH55IFb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--PuDDQYlr--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/217204/5d66fc09-f166-4a95-a5e1-94436bedbe7d.jpeg)
Day 1 — Introduction - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 4 '19 ・ 1 min read
![nerdjfpb](https://res.cloudinary.com/practicaldev/image/fetch/s--gdH55IFb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--PuDDQYlr--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/217204/5d66fc09-f166-4a95-a5e1-94436bedbe7d.jpeg)
Day 2 - Install and Running Node on Window - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 5 '19 ・ 1 min read
![nerdjfpb](https://res.cloudinary.com/practicaldev/image/fetch/s--gdH55IFb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--PuDDQYlr--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/217204/5d66fc09-f166-4a95-a5e1-94436bedbe7d.jpeg)
Day 3 - JavaScript Engine - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 6 '19 ・ 2 min read
![nerdjfpb](https://res.cloudinary.com/practicaldev/image/fetch/s--gdH55IFb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--PuDDQYlr--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/217204/5d66fc09-f166-4a95-a5e1-94436bedbe7d.jpeg)
Day 4 - Window === Global ? - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 7 '19 ・ 2 min read
![nerdjfpb](https://res.cloudinary.com/practicaldev/image/fetch/s--gdH55IFb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--PuDDQYlr--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/217204/5d66fc09-f166-4a95-a5e1-94436bedbe7d.jpeg)
Day 5 - Function Declarations vs. Function Expressions - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 8 '19 ・ 1 min read
![nerdjfpb](https://res.cloudinary.com/practicaldev/image/fetch/s--gdH55IFb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--PuDDQYlr--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/217204/5d66fc09-f166-4a95-a5e1-94436bedbe7d.jpeg)
Day 6 - Require & Module - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 9 '19 ・ 2 min read
![nerdjfpb](https://res.cloudinary.com/practicaldev/image/fetch/s--gdH55IFb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--PuDDQYlr--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/217204/5d66fc09-f166-4a95-a5e1-94436bedbe7d.jpeg)
Day 7 - More Modules - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 10 '19 ・ 2 min read
![nerdjfpb](https://res.cloudinary.com/practicaldev/image/fetch/s--gdH55IFb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--PuDDQYlr--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/217204/5d66fc09-f166-4a95-a5e1-94436bedbe7d.jpeg)
Day 8 – Var vs Let vs Const -Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 11 '19 ・ 2 min read
![nerdjfpb](https://res.cloudinary.com/practicaldev/image/fetch/s--gdH55IFb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--PuDDQYlr--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/217204/5d66fc09-f166-4a95-a5e1-94436bedbe7d.jpeg)
Day 9 – Mastering EventEmitter - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 14 '19 ・ 2 min read
![nerdjfpb](https://res.cloudinary.com/practicaldev/image/fetch/s--gdH55IFb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--PuDDQYlr--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/217204/5d66fc09-f166-4a95-a5e1-94436bedbe7d.jpeg)
Day 10 – Mastering EventEmitter - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 14 '19 ・ 2 min read
![nerdjfpb](https://res.cloudinary.com/practicaldev/image/fetch/s--gdH55IFb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--PuDDQYlr--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/217204/5d66fc09-f166-4a95-a5e1-94436bedbe7d.jpeg)
Day 11 – Creating and Deleting Folders - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 15 '19 ・ 2 min read
![nerdjfpb](https://res.cloudinary.com/practicaldev/image/fetch/s--gdH55IFb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--PuDDQYlr--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/217204/5d66fc09-f166-4a95-a5e1-94436bedbe7d.jpeg)
Day 12 – Creating own server - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 15 '19 ・ 2 min read
![nerdjfpb](https://res.cloudinary.com/practicaldev/image/fetch/s--gdH55IFb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--PuDDQYlr--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/217204/5d66fc09-f166-4a95-a5e1-94436bedbe7d.jpeg)
Day 13 – Buffer & Stream - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 16 '19 ・ 2 min read
![nerdjfpb](https://res.cloudinary.com/practicaldev/image/fetch/s--gdH55IFb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--PuDDQYlr--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/217204/5d66fc09-f166-4a95-a5e1-94436bedbe7d.jpeg)
Day 14 – Serving HTML Pages - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 17 '19 ・ 2 min read
![nerdjfpb](https://res.cloudinary.com/practicaldev/image/fetch/s--gdH55IFb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--PuDDQYlr--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/217204/5d66fc09-f166-4a95-a5e1-94436bedbe7d.jpeg)
Day 15 – Sending JSON to Client - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 18 '19 ・ 2 min read
![nerdjfpb](https://res.cloudinary.com/practicaldev/image/fetch/s--gdH55IFb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--PuDDQYlr--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/217204/5d66fc09-f166-4a95-a5e1-94436bedbe7d.jpeg)
Day 16 – Routing (Basic) - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 19 '19 ・ 2 min read
![nerdjfpb](https://res.cloudinary.com/practicaldev/image/fetch/s--gdH55IFb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--PuDDQYlr--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/217204/5d66fc09-f166-4a95-a5e1-94436bedbe7d.jpeg)
Day 17 – NPM (Node Package Manager) - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 20 '19 ・ 3 min read
![nerdjfpb](https://res.cloudinary.com/practicaldev/image/fetch/s--gdH55IFb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--PuDDQYlr--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/217204/5d66fc09-f166-4a95-a5e1-94436bedbe7d.jpeg)
Day 18 – Why Express JS ? - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 21 '19 ・ 2 min read
![nerdjfpb](https://res.cloudinary.com/practicaldev/image/fetch/s--gdH55IFb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--PuDDQYlr--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/217204/5d66fc09-f166-4a95-a5e1-94436bedbe7d.jpeg)
Day 19 – Nodemon - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 22 '19 ・ 3 min read
![nerdjfpb](https://res.cloudinary.com/practicaldev/image/fetch/s--gdH55IFb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--PuDDQYlr--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/217204/5d66fc09-f166-4a95-a5e1-94436bedbe7d.jpeg)
Day 20 – Express Js Introduction - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 23 '19 ・ 2 min read
![nerdjfpb](https://res.cloudinary.com/practicaldev/image/fetch/s--gdH55IFb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--PuDDQYlr--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/217204/5d66fc09-f166-4a95-a5e1-94436bedbe7d.jpeg)
Day 21 – HTTP methods - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 24 '19 ・ 2 min read
![nerdjfpb](https://res.cloudinary.com/practicaldev/image/fetch/s--gdH55IFb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--PuDDQYlr--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/217204/5d66fc09-f166-4a95-a5e1-94436bedbe7d.jpeg)
Day 22 – Route Parameters - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 25 '19 ・ 3 min read
![nerdjfpb](https://res.cloudinary.com/practicaldev/image/fetch/s--gdH55IFb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--PuDDQYlr--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/217204/5d66fc09-f166-4a95-a5e1-94436bedbe7d.jpeg)
Day 23 – Template Engines - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 28 '19 ・ 3 min read
![nerdjfpb](https://res.cloudinary.com/practicaldev/image/fetch/s--gdH55IFb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--PuDDQYlr--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/217204/5d66fc09-f166-4a95-a5e1-94436bedbe7d.jpeg)
Day 24 – Working with EJS (Part 1) - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 29 '19 ・ 3 min read
![nerdjfpb](https://res.cloudinary.com/practicaldev/image/fetch/s--gdH55IFb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--PuDDQYlr--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/217204/5d66fc09-f166-4a95-a5e1-94436bedbe7d.jpeg)
Day 25 – Working with EJS (Part 2) - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 29 '19 ・ 3 min read
![nerdjfpb](https://res.cloudinary.com/practicaldev/image/fetch/s--gdH55IFb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--PuDDQYlr--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/217204/5d66fc09-f166-4a95-a5e1-94436bedbe7d.jpeg)
Day 26 – Working with EJS (Part 3) - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 30 '19 ・ 3 min read
![nerdjfpb](https://res.cloudinary.com/practicaldev/image/fetch/s--gdH55IFb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--PuDDQYlr--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/217204/5d66fc09-f166-4a95-a5e1-94436bedbe7d.jpeg)
Day 26 – Working with EJS (Part 3) - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 30 '19 ・ 3 min read
![nerdjfpb](https://res.cloudinary.com/practicaldev/image/fetch/s--gdH55IFb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--PuDDQYlr--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/217204/5d66fc09-f166-4a95-a5e1-94436bedbe7d.jpeg)
Top comments (0)