First install Homebrew, then in the terminal run:
brew update brew install mongodb
That’s it! Pretty simple huh? If you want to actually run it, including creating databases, read more in the official MongoDB documentation.