Hi. How are you? This time we are going to talk about MongoDB. It is an opensource NOSQL database based on documents, written in C++, scalable and high performance. MongoDB stores BSON data structures with a dynamic schema. Consequently, the integration of the data in certain applications is easier and faster. Well, let’s see how to install MongoDB on Windows 10.
Downloading the MongoDB binary for Windows.
The first thing we have to do is, go to the official MongoDB website. Go to the download section and select the MSI file, corresponding to Windows in its current version. At the time of publication of this post, the version is 4.2.1.
Once you have downloaded the file, please run it to start the installation. Press Next to start the installation
Then accept the license and click Next to continue
In the next screen select between a Custom or a complete installation. In this case, I select a full installation.
This next screen is very important since we are going to install MongoDB as a Windows service. In other words, always start with the system and be registered. Also, select the directory where the data will be stored. In addition, select the directory where the logs will be stored. Likewise, you can assign the name for the service. Please remember the installation path. You will probably need it later.
Next, the wizard will ask if you want to install MongoDB Compass. This is a graphical interface to manage the data. If you like it, check the box and click Next to continue.
Once you have selected all the installation options, press Install to start the process.
The wizard will start the database installation process.
After a few minutes, the process will be successfully completed.
MongoDB finally installed
If you installed MongoDB Compass Comunity, then you are ready to use the database. This will start automatically once the installation is finished. Press connect to start the database
Then create the database. Assign a name to the collection as well. Press create database to continue.
It is now correctly configured and ready to be used.
Using MongoDB on the terminal
It is also possible to use MongoDB through command. You have to make some preparations, but don’t worry, here we show you how to do it. The first thing we need to do is check if MongoDB was installed as a service, and it’s running. With this in mind please press the Win+R combination and in the box type services.msc
Next, place Mongo Server in the list of services. Please verify that it is Running and that its Startup Type is Automatic.
It then adds an environment variable to run the service on any Command Prompt. To find out how to do it, please check our post about Wget in Windows 10. Here I only show you the final result. Keep in mind that you have to write the installation path that you assigned previously.
To test the operation of MongoDB, please open a cmd and type Mongo.
Conclusion
Finally we have seen how to install MongoDB in Windows 10. The process has been detailed in a simple way. In addition, we have seen how to start the program in graphical mode and through commands as well. All right, that’s it for now. Greetings!