MongoDB를 사용하기 위해서는 Atlas 클라우드 서비스를 이용하는 방법과, 로컬에서 Community Edition을 사용하는 두 가지 방법이 있다. 그 중 Community Edition을 사용할 때 환경 구축 방법이다.
1. MongoDB 공식 사이트에 들어가 Products > Community Edition를 클릭한 후 설치를 진행한다.
2. 설치 창 하단에 install MongoDB Compass를 체크해주고 계속 설치를 진행한다.
3. cmd에서 MongoDB 관련 명령어를 사용할 수 있도록 환경변수 설정을 해준다.
4. 터미널에 'mongod'를 입력하여 정상 설정 되었는지 확인한다.
{"t":{"$date":"2025-04-26T18:51:02.273+09:00"},"s":"I", "c":"NETWORK", "id":23016, "ctx":"listener","msg":"Waiting for connections","attr":{"port":27017,"ssl":"off"}}
{"t":{"$date":"2025-04-26T18:51:02.273+09:00"},"s":"I", "c":"CONTROL", "id":8423403, "ctx":"initandlisten","msg":"mongod startup complete","attr":{"Summary of time elapsed":{"Startup from clean shutdown?":true,"Statistics":{"Set up periodic runner":"0 ms","Set up online certificate status protocol manager":"0 ms","Transport layer setup":"0 ms","Run initial syncer crash recovery":"0 ms","Create storage engine lock file in the data directory":"0 ms","Get metadata describing storage engine":"0 ms","Create storage engine":"163 ms","Write current PID to file":"0 ms","Write a new metadata for storage engine":"...