In this tutorials, we are going to show you how to install MongoDb on Windows 10 operating system.
There are three builds of MongoDB available for Windows - 64-bit, 32-bit and 64-bit Legacy. 64-bit build is the recommended version which can run on Windows Server 2008 R2, Windows 7 64-bit, Windos 10 and newer versions of Windows. 32-bit build have a limitation of 2GB data. 64 bit legacy build is intended for Windows Vista or Windows server. I want to install MongoDB 64 bit on my windows 10 machine. Problem is, it is being installed as a 32-bit application and I'm unable to setuup it as a windows service. I have downloaded 'Windows 64-bit 2008 R2+' version. For windows, I prefer the 64-bit Zip file. The MSI installs into Program Files, but I prefer to keep the binaries and the databases together and not have to run as an Admin. Extract the Zip file to c: MongoDB.
Download MongoDB from the offecial website and follow the below steps.
Select your operating system bit size (32 or 64) and click on Download button. It will ask for your basic information like name and email, then click on the download button, you will see the below screen.
Click on archive hyperlink, then MongoDB automatically start downloading and you can see the file name like mongodb-win32-x86_64-enterprise-windows-64-3.6.3.zip
Copy the file into your favorite location and extract it and rename it as MongoDB-[Version].
Goto MongoDB bin folder and you can find the below files init.
Setup MongoDB :
MongoDB requires a data directory to store the information, for this we need to create a folder with the name of dataand give that folder path to MongoDB as part of the config file. Else we should create a data directory inside C: directory.
mongo.config is a plain text file, it contains data folder path, logs path information and etc.
We can run the MongoDB server by running mongod.exe
Now MongoDB server in listining mode. To use the databse and create documents, open another cmd prompt and run the mongo.exe
By executing the above command, you will be enter in to MongoDB’s shell like above.
Execute simple MongoDB commands to check.
MongoDB gives us above 3 databases (admin,config,local) by default.
Happy Learning 🙂