How to Install MongoDB on MacOS. MongoDB is an open source, cross platform document-oriented database management system. It is a NoSQL database which stores data and schemas as JSON objects. Mongodb is developed by Mongodb Inc and is published under GNU affero General Public License and Apache. MongoDB Atlas - the global cloud database MongoDB Atlas is the multi-cloud database service for MongoDB available on AWS, Google Cloud, and Azure. Best-in-class automation and built-in proven practices provide continuous availability, elastic scalability,.
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.
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 | $tar-zxvf mongodb-osx-ssl-x86_64-3.6.1.tgz $sudo mvmongodb-osx-ssl-x86_64-3.6.1/usr/local/mongodb |
STEP 2 – Create MongoDB Data directory (/data/db
)
MongoDB stores the data into the /data/db directory by default, so we need to create this directory and also assign proper permission using chown command.
Open the terminal run the following command
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) |
Mongodb Download On Mac Mojave
Video : How to install MongoDB on Mac OS X