중요
Mongo쉬 방법
This page documents a mongosh method. This is not the documentation for a language-specific driver, such as Node.js.
MongoDB API 드라이버의 경우 언어별 MongoDB 드라이버 설명서를 참조하세요.
db.getMongo()반환합니다: 현재 데이터베이스 연결
db.getMongo()runs when the shell initiates. Use this command to test thatmongoshhas a connection to the proper database instance.
참고
The legacy mongo shell has a sub-command, db.getMongo().setSecondaryOk(), which is not available in mongosh. In mongosh, use Mongo.setReadPref() instead.
호환성
이 메서드는 다음 환경에서 호스팅되는 배포에서 사용할 수 있습니다.
- MongoDB Atlas: 클라우드에서의 MongoDB 배포를 위한 완전 관리형 서비스
참고
이 명령은 모든 MongoDB Atlas 클러스터에서 지원됩니다. 모든 명령에 대한 Atlas 지원에 관해 자세히 알아보려면 지원되지 않는 명령을 참조하세요.
MongoDB Enterprise: MongoDB의 구독 기반 자체 관리 버전
MongoDB Community: MongoDB의 소스 사용 가능 무료 자체 관리 버전