sajad torkamani

Install brew package

brew tap mongodb/brew
brew update
brew install mongodb-community # This will install latest stable version

Binaries installed

This will install the following binaries:

Location of key files and directories

File / directory typeLocation
Config file/opt/homebrew/etc/mongod.conf
Log directory/opt/homebrew/var/log/mongodb
Data directory/opt/homebrew/var/mongodb

Manage service

Start service:

brew services start mongodb-community

Stop service:

brew services stop mongodb-community

See this post for more information on managing services via Homebrew.

Use MongoDB REPL

mongosh

Sources