Mongo CLI 설치
brew tap mongodb/brew
brew install mongodb-community@5.0
mongodb-database-tools는 내장되어있지만 추가 설치가 필요한 경우
brew install mongodb-database-tools
Brew Install 실패하는 경우
Error: Permission denied @ apply2files - /usr/local/lib/docker/cli-plugins
mkdir -p /Applications/Docker.app/Contents/Resources/cli-plugins
brew cleanup
mongod
"error":"NonExistentPath: Data directory /data/db not found.
Mac Catalina (10.15이상)부터는 root폴더에 Writing이 불가능 ( 임의 폴더 지정 )
mongod --dbpath=/Users/user/data/db
mongorestore
https://docs.mongodb.com/database-tools/mongorestore/
mongorestore --archive="/Users/heon/data/dump/mongodump-classes-db" --nsFrom='classes.' --nsTo='classes.';
'DB > MongoDB' 카테고리의 다른 글
[ MONGODB ] 기간 조회 (0) | 2022.06.08 |
---|---|
[ MongoDB ] MongoDB update : useUnifiedTopology: true (0) | 2021.10.10 |
[ MongoDB ] Populate Self Reference Fail (0) | 2021.05.11 |
[ MongoDB ] match 사용 (0) | 2021.01.06 |
[ MongoDB ] Object Child Update Detection (0) | 2021.01.04 |