DEV Community

Cover image for Day 30 – NO-SQL Database with Node js - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb)
Muhammad Ali (Nerdjfpb)

Posted on • Originally published at blog.nerdjfpb.com

Day 30 – NO-SQL Database with Node js - Learning Node JS In 30 Days [Mini series]

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/

Alt Text

Installing is pretty easy. Just putting npm install mongoose will done the work. You can write npm i mongoose too.

Alt Text

After requiring the mongoose using const mongoose = require('mongoose') we just need to put the database name on the connection

Like this

Alt Text

We can easily find the schema in the mongoose official page

Alt Text

Alt Text

In the time on making live project, you can use mlab for the hosting mongodb.

Alt Text

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)

Top comments (0)