MongoDB Installation and Workspace Guide


MongoDB Installation and Workspace Guide

MongoDB is a NoSQL-based, document-oriented database system frequently preferred in modern applications. MongoDB, which stands out with its high performance, flexible data structure and easy scalability, is widely used in both small projects and large enterprise applications. In this guide, how to do the MongoDB installation and basic workspace settings will be covered step by step.

How to Install MongoDB?

MongoDB Installation for Windows

You can follow the steps below to install MongoDB on a Windows environment:

choco install mongodb-community

If you are not using Chocolatey, you can download the MSI file from MongoDB Community Edition Download and start the classic installation. After the installation is complete, use the following command to start the database service:

net start MongoDB

MongoDB Installation for Linux (Ubuntu Example)

It is very easy to install MongoDB from terminal on Ubuntu systems. Enter the commands below in your terminal, in order:

sudo apt-get update
sudo apt-get install -y mongodb

After installation, to start the service:

sudo systemctl start mongodb
sudo systemctl enable mongodb

Creating the MongoDB Workspace

Using MongoDB Shell (mongosh)

You can use the "mongosh" interface to interact with MongoDB. With the "mongosh" command, you can easily add data, query, and create collections from the command line:

mongosh

After a successful connection, you can start applying MongoDB commands. Example of creating a collection and adding data:

use testDB
db.users.insertOne({ name: "Ayşe", age: 25 })

Graphical Management with MongoDB Compass

For those who want a more comfortable workspace, the free MongoDB Compass interface is an ideal option. With Compass, you can visually manage collections, documents, indexes and queries. After installation, you can easily connect to the localhost:27017 address by launching the application.

Conclusion and Recommendations

MongoDB installation and workspace settings are quite simple. You can follow the steps above to get a quick start in your personal or professional projects. Thanks to the MongoDB Installation and Workspace Guide, you can maintain your database management in a modern and effective way and add flexibility to your applications. We recommend that you discover the advanced features offered by MongoDB more closely by practicing a lot during your development processes.