Day 30 – NO-SQL Database with Node js - Learning Node JS In 30 Days [Mini series]
Tags: node, javascript, codenewbie, tutorial
Published: 2020-01-02 20:06:28

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](https://thepracticaldev.s3.amazonaws.com/i/069q7uaps7tt5chh7yjg.png)

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

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/ubpqm3kiorgiuhbj7fqa.png)

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

Like this

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/smulxoy7g6xe3elgyqh8.png)

We can easily find the schema in the mongoose official page

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/7yuoyqomwilm6rdo3eor.png)

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/x9opt3hw7pcxp8jwydz6.png)

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

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/g90sskcam13n9zz6a7c1.png)

So are you confident enough that you can read & understand some node js code right now ?

You can see the graphical version here
{% instagram B61FYFuAM4c %}

Originally it published on [nerdjfpbblog](https://blog.nerdjfpb.com/day30-nodejsin30days/). You can connect with me in [twitter](https://twitter.com/nerdjfpb) or [linkedin](https://www.linkedin.com/in/nerdjfpb/) !


###__You can read the old posts from this series (below)__

{% post nerdjfpb/day-1-learning-node-js-in-30-days-mini-series-55e7 %}

{% post nerdjfpb/day-2-learning-node-js-in-30-days-mini-series-5023 %}

{% post nerdjfpb/day-3-learning-node-js-in-30-days-mini-series-24i4 %}

{% post nerdjfpb/day-4-learning-node-js-in-30-days-mini-series-1koc %}

{% post nerdjfpb/day-5-learning-node-js-in-30-days-mini-series-21jm %}

{% post nerdjfpb/day-6-learning-node-js-in-30-days-mini-series-758 %}

{% post nerdjfpb/day-7-learning-node-js-in-30-days-mini-series-3023 %}

{% post nerdjfpb/day-8-var-vs-let-vs-const-learning-node-js-in-30-days-mini-series-1i72 %}

{% post nerdjfpb/day-9-mastering-eventemitter-learning-node-js-in-30-days-mini-series-2dfe %}

{% post nerdjfpb/day-10-mastering-eventemitter-learning-node-js-in-30-days-mini-series-2802 %}

{% post nerdjfpb/day-11-creating-and-deleting-folders-learning-node-js-in-30-days-mini-series-3a2d %}

{% post nerdjfpb/day-12-creating-own-server-learning-node-js-in-30-days-mini-series-3ef %}

{% post nerdjfpb/day-13-buffer-stream-learning-node-js-in-30-days-mini-series-5c5d %}

{% post nerdjfpb/day-14-serving-html-pages-learning-node-js-in-30-days-mini-series-2hl3 %}

{% post nerdjfpb/day-15-sending-json-to-client-learning-node-js-in-30-days-mini-series-21pc %}

{% post nerdjfpb/day-16-routing-basic-learning-node-js-in-30-days-mini-series-5hk6 %}

{% post nerdjfpb/day-17-npm-node-package-manager-learning-node-js-in-30-days-mini-series-1nek %}

{% post nerdjfpb/day-18-why-express-js-learning-node-js-in-30-days-mini-series-b5a %}

{% post nerdjfpb/day-19-nodemon-learning-node-js-in-30-days-mini-series-m39 %}

{% post nerdjfpb/day-20-express-js-introduction-learning-node-js-in-30-days-mini-series-2pg5 %}

{% post nerdjfpb/day-21-http-methods-learning-node-js-in-30-days-mini-series-hci %}

{% post nerdjfpb/day-22-route-parameters-learning-node-js-in-30-days-mini-series-4knk %}

{% post nerdjfpb/day-23-template-engines-learning-node-js-in-30-days-mini-series-4f7d %}

{% post nerdjfpb/day-24-working-with-ejs-part-1-learning-node-js-in-30-days-mini-series-493 %}

{% post nerdjfpb/day-25-working-with-ejs-part-2-learning-node-js-in-30-days-mini-series-19gp %}

{% post nerdjfpb/day-26-working-with-ejs-part-3-learning-node-js-in-30-days-mini-series-1ofd %}

{% post nerdjfpb/day-26-working-with-ejs-part-3-learning-node-js-in-30-days-mini-series-1ofd %}

{% post nerdjfpb/day-27-working-with-static-files-learning-node-js-in-30-days-mini-series-5h1f %}

{% post nerdjfpb/day-28-middlewares-learning-node-js-in-30-days-mini-series-461b %}

{% post nerdjfpb/day-29-sql-database-with-node-js-learning-node-js-in-30-days-mini-series-1ne0 %}