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

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 ?

Leave a Reply

Your email address will not be published. Required fields are marked *