After installing brew from brew.sh
#install
brew tap mongodb/brew
brew install mongodb-community
#setup database directory
sudo mkdir -p /System/Volumes/Data/data/db
sudo chown -R `id -un` /System/Volumes/Data/data/db #if no errors good to go
#tell mongo new db path
sudo mongod --dbpath /System/Volumes/Data/data/db
mongo
mongod
#Install xcode command line tools if you don't have
xcode-select --install
#Install homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
#Install mongodb
brew tap mongodb/brew
brew update
brew install mongodb-community@5.0