brew tap mongodb/brew
brew install [email protected]
In addition to the binaries, the install creates:
the configuration file (/usr/local/etc/mongod.conf)
the log directory path (/usr/local/var/log/mongodb)
the data directory path (/usr/local/var/mongodb)
brew services start [email protected]
mongo