First install Homebrew, then in the terminal run:
brew updatebrew 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.