In this blog post, I will give a detailed view of downloading and installing MongoDB 5 on your Windows 11 Operating System.
1. Open a web browser of your choice and search for MongoDB. Scroll down and click on mongodb.com.
2. Once the link opens, hover over the products tab and click on Community server under Community edition.
3. It will redirect you to the downloads page. I am going to download the MongoDB community server. I am going to install the current version. The platform is windows and the package is MSI. Then, click on the Download button. It will start to download.
4. Once the download is complete, click on the MSI file and minimize the browser.
5. In the first window, click on the Next button.
6. In the license agreement window, accept the agreement and click on Next.
7. In the setup type window, choose complete setup.
8. In this window, choose the first radio button. If you don’t have any reason to change the data directory and log directory, leave it as default and click on Next.
9. In the next window, leave the checkbox as checked and click on Next.
10. In this window, click on the Install option.
11. It will show a warning. Click on Yes.
12. Once the installation is finished, click on the Finish button.
13. You can check whether it is installed or not by opening the command prompt. Click on the search icon and search for cmd. Once the command prompt opens, type mongo and press enter. It will say mongo is not recognized. This is because we have not set the environment variable.
14. Go to the location where MongoDB is installed. Go to the bin folder and copy the path. Click on the search icon and search for environment variables. Once it opens, click on the path under system variables.
15. Click on New and paste the path. Click Ok on all the tabs.
16. Open the command prompt once again, type mongo, and press enter. This time it will show the version of mongo.
17. If you want to view all the databases then type show dbs; and press enter. It will display all the databases.
18. To create a new database you need to type use and the name of your database. I am going to name it as use mydb and press enter. Once you have created the database is created you can give the show db command and check whether the database is added or not. But still, it will not display the name of the database that you have created. This is because you have to fill your database with some documents. Then only it will display the database.
19. To fill in some data, type the command provided in the image below. It will insert the database. When you type show dbs;, it will display the newly added database.
20. To view all the collections inside your database, type show collections; and press enter. It will display all the collections inside that database.
21. To view the data or documents type the command provided in the image below. It will display all the documents. Now minimize the command prompt and go to MongoDB.
22. When you start for the first time it will display this kind of window. Click on Next in all the windows. Click on Get Started in the last window.
23. Click on start using compass.
24. To create a new database connection, click on Connect, and click on click on a new connection. To connect a database, we need a connection string. To know more about the connection string, you can click on the info icon.
25. It will redirect you to a website where you can know more about connection strings.
26. When you go to the command prompt you will be able to see the connection string. You have to copy that path and paste it into the connection string area. Once you have pasted, click on Connect.
27. It will connect you to the MongoDB server. On the left-hand side, you will be able to see all the databases.
28. When you click on the database that we have created in the command prompt, it will display the number of documents that we have created.
29. When you click on the document, it helps to visualize your data inside.
These are the steps for downloading and installing MongoDB 5 on your Windows 11 Operating System.
Leave a Reply