Node.js Create Connection with MongoDB

MongoDb is a NoSQL database. It can be used with Node.js as a database to insert and retrieve data.

Download MongoDB

Open the Linux Command Terminal and execute the following command:

apt-get install mongodb  

It will download the latest MongoDB according to your system requirement.

Node.js Create connection 1

Install MongoDB

After the complete download, use the following command to install MogoDB.PlayNextMute

Current Time 0:01

/

Duration 18:10

Loaded: 3.30%

 Fullscreen

npm install mongodb --save   

Use the following command to start MongoDb services:

service mongodb start  
Node.js Create connection 2

Now, connection is created for further operations.

To download and install MongoDB on windows, see the following page:


Comments

Leave a Reply

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