MongoDBの公式で紹介されたようにインストールできます。
-
brew tap mongodb/brew
-
brew install mongodb-community@4.4
サービスの起動:
brew services start mongodb-community@4.4
または
brew services start mongodb/brew/mongodb-community
サービスの停止:
brew services stop mongodb-community@4.4
または
brew services stop mongodb/brew/mongodb-community
コマンドが長いので、以下のようにエイリアスを作ると便利です。
~/.zshrcや~/.bashrcとか。
alias mongod-start='brew services start mongodb/brew/mongodb-community' alias mongod-stop='brew services stop mongodb/brew/mongodb-community'