Brew Mongodb



Install with Homebrew

Set up launchctl to auto start mongod

MongodbBrew

The MongoDB Command Line Interface (mongocli) is a tool for managing your MongoDB cloud services, like MongoDB Atlas, MongoDB Cloud Manager, and MongoDB Ops Manager. With the MongoDB CLI, you can quickly interact with your MongoDB deployments from the command line for easier testing and scripting. Installs (30 days) mongodb-compass: 869: Installs (90 days) mongodb-compass: 2,440: Installs (365 days) mongodb-compass: 8,218. For example, to install MongoDB with Homebrew, you need to tap into mongodb/brew formula: $ brew tap mongodb/brew Then you can install MongoDB like this: $ brew install mongodb-community To remove an already tapped repository, use the untap command: $ brew untap mongodb/brew To view all tapped repositories, you use the following: $ brew tap.

/usr/local/opt/mongodb/ is a symlink to /usr/local/Cellar/mongodb/x.y.z (e.g., 2.4.9)

You can use launchctl to start and stop mongod

You can also more conveniently use brew to start, stop, and verify service status

Notes

Brew Mongodb Stop

Mongodb

The default plist provided by homebrew stores the mongod configuration at /usr/local/etc/mongod.conf. This configuration specifies the dbpath to be /usr/local/var/mongodb instead of the default /data/db.

Brew Mongodb

Brew Mongodb Start

For more about launchctl see: