You can use Homebrew to install MongoDB on a Mac.
For ages you were able to simply do:
brew install mongodb, but more recently, that has stopped working as it was removed from homebrew-core. Now, you need to do it as follows:
You can read more about it here if you’d like.