#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