In this blog post, I am going to share with you how you can install MongoDB on Windows machine. Well, there are hundreds of tutorials available online related to this topic. You must be thinking why I need to create another tutorial. Well, thats true there are lots of tutorials out there, but those are old and outdated.
Infact, I have checked many of them, but when I am not satisfied with those tutorials, then I planned to create my tutorial from scratch. In my tutorial, you will learn to Setup MongoDB on Windows from scratch, and this tutorial is created with the latest updates.
If you are a MacOS user and wanted to setup MongoDB on mac, then you can check out this tutorial: Easy Way to Install MongoDB on MacOS. This tutorial help you to setup MongoDB on Mac machine from starting.
In order to set up MongoDB on Windows machine, it needs to be manually downloaded from their official website. Visit the MongoDB official website, you will see below options:
- Version
- OS
- Package
- Download Button
When your MongoDB file is completely downloaded, then move to the directory where the MongoDB installer (.msi) is kept. Double click on the installer, it will ask for accepting the Licence agreement. Then click on the complete button, and your installation process will start.
Now here comes the critical part, in order to work with MongoDB on Windows machine, we should add the bin folder’s path in the environmental variables.
Right click on This PC => Advanced system setting => Environment Variables => System variables (Double click on it).
When you reached to System variables double click on it and include this line of code. As you can see I am using 4.0.9 MongoDB version in the path you can use whichever version you’ll be using at the time of setting up MongoDB in Windows machine.
C:\Program Files\MongoDB\Server\4.0\bin
You can easily confirm which MongoDB version you are using by running the given below command in your terminal.
mongo --version
MongoDB shell version v4.0.6
git version: caa42a1f75a56c7643d0b68d3880444375ec42e3
allocator: system
modules: none
build environment:
distarch: x86_64
target_arch: x86_64
Create a folder to store MongoDB data, hit the following command.
md c:\mongo_data\db
Everything has been put on its place, and now it’s time to hit the command mongod
in terminal to run mongo daemon. This service runs listens about the connection and works in the background.
mongod
Mongo daemon is working correctly in the background, and your applications are ready to be served by MongoDB on Windows. I would suggest always use latest version softwares and libraries to get rid of the compatibility issue with client-side apps.
In this post, we will learn how to work with HTTP requests in the Redux…
MySQL is a relational database management system based on SQL – Structured Query Language, and…
React Js Handle Rest API data globally with Context and useState hook tutorial. In this…
Node js delete data from MySQL database tutorial; Throughout this guide, you will ascertain how…
In this tutorial, you will discover how to import CSV file into MySQL database using…
React Js Global state management with createContext hook example; In this tutorial, we will help…