MongoDB Installation — MongoDB Client
Setting-up MongoDb and utilizing via graphical user interface client.
In part II of this series, modeling in NoSQL was covered in detail with multiple examples. This article will cover installation:
- MongoDB Installation
- Installing GUI for MongoDB server — Supported tool.
If tools are already installed on your system then you can jump directly to the next article:
1. MongoDB installation on macOS:
Follow the mentioned steps.
* Manually:
MongoDB site has the link to download the specific version as per OS and compression requirements.
* Brew:
In case you are like dealing from terminal then “brew” is a good option. In case if you don’t have brew then first install and type below commands:
brew update
brew tap mongo/brew
brew install mongodb
orbrew install mongodb@preferred-version
* Configurations:
- Create “db” directory, where files reside by typing
mkdir -p /data/db
- Provide permissions by
sudo chown -R `id -un` /data/db
- Start MongoDB server by
mongod
- Open another tab access server data from mongo shell by
mongo
MongoDB installation on windows:
https://docs.mongodb.com/v3.2/tutorial/install-mongodb-on-windows/
It’s super easy to install through the .msi file. During installation, an option is available to change the MongoDB default location for storing data and log files from the following dialogue.
You can launch MongoDB from a .exe file, or from the terminal:
"C:\Program Files\MongoDB\Server\3.2\bin\mongod.exe"
Even if you forgot to change the location during installation, still you got an option to use different data location by passing a path at the time of starting MongoDB server from terminal.
"C:\Program Files\MongoDB\Server\4.2\bin\mongod.exe" --dbpath d:\test\mongodb\data
2. Robo 3T/Studio 3T — GUI for MongoDB
Although MongoDB shell is available to access from the terminal, GUI’s are always been more user-friendly.
I prefer working with either Robo 3T or Studio 3T, other options are also available as per preferences.
After installation, connect to MongoDB server from Robo 3T/Studio 3T:
Hurrah, MongoDB and other basic tools are installed, the next article focuses focus on writing basic and advanced queries in MongoDB: