更新的答案(9/2/2019):
Homebrew已从其核心存储库中删除了mongodb公式,请参阅此拉取请求。
使用Homebrew安装mongodb的新方法如下:
~> brew tap mongodb/brew
~> brew install mongodb-community
安装后,您可以按照以下说明启动mongodb服务:
~> brew info mongodb-community
mongodb/brew/mongodb-community: stable 4.2.0
High-performance, schema-free, document-oriented database
https://www.mongodb.com/
Not installed
From: https://github.com/mongodb/homebrew-brew/blob/master/Formula/mongodb-community.rb
==> Caveats
To have launchd start mongodb/brew/mongodb-community now and restart at login:
brew services start mongodb/brew/mongodb-community
Or, if you don't want/need a background service you can just run:
mongod --config /usr/local/etc/mongod.conf
已弃用的答案(8/27/2019):
我认为您正在使用Homebrew。您可以使用查看所需的其他信息brew info $FORMULA
~> brew info mongo 255
mongodb: stable 2.4.6, devel 2.5.1
http:
/usr/local/Cellar/mongodb/2.4.5-x86_64 (20 files, 287M) *
Built from source
From: https:
==> Caveats
To reload mongodb after an upgrade:
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
安装后需要遵循的警告。