Firstly you will have to download the latest release of MongoDB:
You can download an appropriate version of MongoDB which your system supports, from the link "http://www.mongodb.org/downloads" to install the MongoDB on Windows. You should choose correct version of MongoDB acording to your computer's Window. If you are not sure what Window version are you using, open your command prompt and execute this command:
C:\ wmic os get osarchitecture
This version of MongoDB runs only on Window Server 2008 R2, Window7 64 bit, and the newer version of windows. You can't operate it on older version of windows.
This version of MongoDB runs only on newer version of Windows contains 64 bit operating system.
for example: Window Server 2008 R2, Window 7 64 bit etc.
This version of MongoDB runs on only 32 bit windows. 32 bit version of MongoDB is generally used in testing and development purposes because it supports databases smaller than 2 GB.
In Window explorer, locate the downloaded MongoDB msi file, double click on that file and follow the instructions appears on the screen. These instructions will guide you to complete the installation process.
Select Start Menu > All Programs > Accessories
You can install MongoDB in any folder because it is self contained and does not have any other system dependency.
A data directory is required in MongoDB to store all the information. Its by default data directory path is \data\db. you can create this folder by command prompt.
md\data\db
For example:
If you want to start MongoDB, run mongod.exe
You can do it from command prompt.
C:\Program Files\MongoDB\bin\mongod.exe
This will start the mongoDB database process. If you get a message "waiting for connection" in the console output, it indicates that the mongodb.exe process is running successfully.
For example:
When you connect to the MongoDB through the mongo.exe shell, you should follow these steps:
For example:
C:\mongodb\bin\mongo.exe
If you use the different data directory while MongoDB installation, specify the directory when connecting.
For example:
C:\mongodb\bin\mongod.exe-- dbpath d:\test\mongodb\data
If you have spaces in your path, enclose the entire path in double space.
For example:
C:\mongodb\bin\mongod.exe-- dbpath "d: \ test\mongodb\data"
First to create a configuration file and a directory path for MongoDB log output after that create a specific directory for MongoDB log files.