In this tutorial, I will show you how we can install the MongoDB in Window environment.
To download MongoDB, you can go to the download page of MongoDB at https://www.mongodb.com/download-center?jmp=nav#community, and choose the version suitable for your machine.
Currently, the latest version of MongoDB is 3.2.9.
I am using Window 8 64bit, so I will download the version 64bit of MongoDB for Window. The binary file which I downloaded, named mongodb-win32-x86_64-3.2.9-signed.msi.
Steps to install
After downloading the install package to your machine, you can double click on the binary file. A dialog will be displayed as below:
Press button Next to continue.
Click the checkbox I accept the terms in the License Agreement, then press button Next.
Here, you can press the button Complete to install all existing features of MongoDB.
Press button Install to start the installation.
After the installation is completed
You can press the button Finish to finish installing MongoDB into our computer.
By default, MongoDB will be installed at C:\Program Files\MongoDB\Server\3.2.
Environment configuration for MongoDB
To run, MongoDB need a folder to store the data. By default, this folder will be located at C:\data\db. So that, we need to create this folder:
MongoDB will use the file, named mongod.exe in the folder C:\Program Files\MongoDB\Server\3.2\bin to run.
So that, you need open the command line and go to the folder C:\Program Files\MongoDB\Server\3.2\bin, then run MongoDB by using this file mongod.exe as below:
Now, we ran MongoDB sucessfully!
Connect to MongoDB
To connect to MongoDB, we will use the file mongo.exe in the same folder of mongod.exe, C:\Program Files\MongoDB\Server\3.2\bin.