# install homebrew (https://brew.sh/) and run the following commands
sudo chown -R $(whoami) $(brew --prefix)/*
brew tap mongodb/brew
brew install mongodb-community@4.2
## --- aliases to set in your zshrc file
# open your zshrc file
open ~/.zshrc
# copy and paste shorcuts in the end of the file
alias mongod='brew services run mongodb-community'
alias mongod-start='brew services start mongodb-community' #will start MongoDB automatically when you login into your Macbook
alias mongod-status='brew services list'
alias mongod-stop='brew services stop mongodb-community'
# restart your terminal
# type mongod in your terminal for run service & mongod-stop for finish it
# test your mongodb connection with
mongo
show dbs