05-11 02:48
Notice
Recent Posts
Recent Comments
관리 메뉴

Scientific Computing & Data Science

[MongoDB] MongoDB Shell 본문

Data Science/MongoDB

[MongoDB] MongoDB Shell

cinema4dr12 2014. 1. 13. 23:28

Written by cinema4d

MongoDB 서버가 실행된 상태에서 (./mongod) Terminal을 하나 더 실행한 후 MongoDB의 path로 이동하여 다음과 같이 입력한다.

./mongo
MongoDB shell version: 2.4.8
connecting to: test
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
	http://docs.mongodb.org/
Questions? Try the support group
	http://groups.google.com/group/mongodb-user
Server has startup warnings: 
Mon Jan 13 23:21:38.536 [initandlisten] 
Mon Jan 13 23:21:38.536 [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000


실행이 성공하면 ">" 프롬프트가 나타나며 이 곳에 쿼리 실행문을 입력하게 된다.

환경변수 설정을 통해 굳이 MongoDB가 설치된 path로 이동하지 않고 실행할 수 있다.

MongoDB에 대한 환경변수를 설정하는 방법이 이 곳(2. MongoDB 환경변수 설정)을 참고하기 바란다.

데이터베이스를 저장할 곳을 임의로 지정할 수 있는데, 우선 저장할 폴더를 생성한 후, 커맨드라인 툴을 실행하고(MacOS - terminal 또는 쉘, Windows - 도스 콘솔) 예를 들면 다음과 같다:

$ mongod -dbpath [db 경로]


Comments