Mac平台安装MongoDB
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/
官方安装tutoral如上
使用brew安装
brew tap mongodb/brew
brew install mongodb-community@4.4
其中@后面的4.4是最新的版本号
安装信息:(what the brew install creates):
- configuration file
/usr/local/etc/mongod.conf
- log directory path
/usr/local/var/log/mongodb
- Data directory path
/usr/local/var/mongodb
It is recommended to run MongoDB as a macOS service, as doing so sets the correct system
ulimit
values automatically (see ulimit settings for more information).
用brew命令运行和结束mongod process as a macOS service:
brew services start mongodb-community@4.4
brew services stop mongodb-community@4.4
想证明MongoDB在本机上云顶,可以在运行进程中搜索mongod.
ps aux | grep -v grep | grep mongod
Create and Use MongoDB
mongo
MongoDB CRUD Operations
其实insert啥的都比较简单,比较复杂的就是那个find命令。
- 最简单的就是映射。