MondoDB mac版安装及使用
prerequisites
1. Install Xcode Command-Line Tools
xcode-select --install
2. Install Homebrew
https://brew.sh/#install
install
1. brew tap mongodb/brew
2. brew update
3. brew install mongodb-community@6.0
what is included?
install path
You can also run the following command to check where brew has installed these files and directories:
brew --prefix
run
1. 开启服务
start and stop
as a macOS service
brew services start mongodb-community@6.0
brew services stop mongodb-community@6.0
manually as a background process
intel
mongod --config /usr/local/etc/mongod.conf --fork
m1
mongod --config /opt/homebrew/etc/mongod.conf --fork
To stop a mongod running as a background process, connect to the mongod using mongosh, and issue the shutdown command as needed.
2. 连接
mongosh
reference
https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-os-x/