추출
MongoDB 홈페이지에 접속하여 mongodb-database-tool 다운로드
다운로드 링크
다운 받은 파일의 bin 디렉토리 내부에서 명령어를 실행한다.
./mongoexport --uri="mongodb+srv://cluster0.texal2d.mongodb.net/" -u Dustin -d sample_mflix -c comments -o dump.json
(uri: 해당 데이터베이스 연결을 위한 주소, -u: 유저이름, d: 추출할 데이터베이스 이름, -c: 추출한 컬렉션 이름, -o: dump.json 이름으로 output)

(실제 vi dump.json 명령어로 확인한 json파일의 일부)
삽입
1. ./mongoimport --uri="mongodb+srv://cluster0.texal2d.mongodb.net/" -u Dustin -d test -c comment dump.json
(uri: 해당 데이터베이스 연결을 위한 주소, -u: 유저이름, d: 삽입할 데이터베이스 이름, -c: 삽입할때 만들어질 컬렉션 이름)
