MongoDB 실행
//install
$ brew tap mongodb/brew
$ brew update
$ brew install mongodb-community@7.0
//run using homebrew
$ brew services start mongodb-community@7.0
$ brew services stop mongodb-community@7.0
//run as background process (Apple Silicon)
$ mongod --config /opt/homebrew/etc/mongod.conf --fork
$ mongod --dbpath /path/to/dbdir --logpath /path/to/mongodb.log --fork
MongoDB SH 접속
$ mongosh
MongoDB Database 생성 및 확인
//create database
$ use {db_name}
//show databases, collections
$ show dbs
$ show collections
Spring-Data-MongoDB
MongoDB 특징
- mongodb는 document(JSON) 형태(schema-less)로 데이터를 저장