Install MongoDB


MongoDB is NoSQL database

MongoDB is a cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with optional schemas. MongoDB is developed by MongoDB Inc. and licensed under the Server Side Public License.

An official documentation is attached.

Learn More:


  1. Install MongoDB Community Edition on Mac

1. Install MongoDB Community Edition on Mac with Home brew

Install Homebrew

$ /bin/bash -c "$(curl -fsSL" 

Tap the MongoDB Homebrew Tap

$ brew tap mongodb/brew


$ brew install mongodb-community@4.4

Start MongoDB

$ brew services start mongodb-community@4.4

Stop MongoDB

$ brew services stop mongodb-community@4.4

manually as a background process

$ mongod --config /usr/local/etc/mongod.conf --fork
  • To stop a mongod running as a background process, connect to the mongod from the mongo shell, and issue the shutdown command as needed.

To verify that MongoDB is running, search for mongod in your running processes

$ ps aux | grep -v grep | grep mongod

Connect and Use MongoDB

$ mongo

To begin using MongoDB, connect a mongo shell to the running instance. From a new terminal, issue the following.

Posted in DB

Leave a Reply

Your email address will not be published.