In this post we will see How to install MongoDB on Mac OS X. MongoDB is one of the most used, open-source document database, and NoSQL database. MongoDB is developed by 10gen.
MongoDB: Install on MacOS In this tutorial, we present a step by step tutorial on how to install MongoDB on Mac OS. The operating system considered for this tutorial is macOS 10.14 (Mojave). Mongoclient is a cross-platform solution for connecting to and managing MongoDB databases: the app enables you to configure multiple connections, provides support for using URLs, and can also work.
STEP 1 – Downloading MongoDB .tgz
file
Visit MongoDB official website and download the .tgz file from the community section of the website.
Now extract the downloded .tgz
and mv the mongo directory to /usr/local/mongod
b directory using following command in terminal.
2 4 | $whoami $sudo chowncodebind/data/db |
STEP 3 – Set mongodb/bin PATH to ~/.bash_profile
Now we need to set the envirent variable for MongoDb, So the mongo and mongod command can be recognized from the terminal.
For that we need to add the mongodb/bin path to the ~/.bash_profile
file.
Mongodb Download Mac Os 10.10

2 | export PATH=$PATH:$MONGO_PATH/bin |
Now restart your terminal and verify the mongodb version by following commands
2 | MongoDB shell version:3.6.1 |
STEP 4 – Start MongoDB
In order to work with mongodb we need to first run the mongod
command which starts the mongo daemon .
So open two different terminals.
Now in
terminal 1
run the following command
2 4 6 | MongoDB shell version:3.6.1 >show dbs admin(empty) |
Video : How to install MongoDB on Mac OS X
