How to Install and Configure MongoDB in Windows?

MongoDB is a no SQL Database. Like SQL here we don’t need to Create schema. MongoDB is a document based database. Table & Relationship between tables are not available with MongoDB. MongoDB is also ignored Complex Joins. It is simple & easy to use. MongoDB uses internal memory for storing. The cause MongoDB provides faster access to data. The format MongoDB follows to store data is JSON style documents. This database mechanism is rich with Replication & High Availability. To operate MongoDB it provides simple query structure. The best place to use MongoDB are like Big Data or Data Hub. Backup database is so simple using MongoDB. These are the causes MongoDB is getting popular day by day.

In this session let us describe step by step how to install & run MongoDB in Windows Operating System. Compare to SQL database installation MongoDB takes very less time to install.

Download MongoDB Installer

To start installation of MongoDB for Windows download Windows installer (msi) from http://www.mongodb.org/downloads. Depending upon your machine configuration download the respective msi installer (64 bit or 32 bit).

Install the MongoDB msi

Once the download is complete. Go to your download folder. Install the msi installer in your machine. During installation set installation path to C:/Program Files/MongoDB.

Configure MongoDB Data Directory

To run MongoDB you need to provide DB path. To do this right click on Command Prompt & open it as “Run as Administrator”. Create a directory where you want to keep your database. Here let us assume we want to store our database in C:/db. Issue the command “md db”. It will create a folder db in your C drive. Now to run MongoDB in command mode change directory to C:/Program File/MongoDB/Bin. Then issue the following command.

mongod.exe –dbpath C:/db

Run MongoDB using Robomongo

To run MongoDB you need to install Robomongo. Download the Windows version of Robomongo from http://robomongo.org. Robomongo is a shell-centric cross-platform open source MongoDB management tool. With the help of this tool you can operate your MongoDB from Admin UI. To run with Robomongo you need to start MongoDB. Once MongoDB started Open Robomongo & Connect to MongoDB. Using Robomongo you can easily create Databases or can execute Queries.