정의
호환성
이 명령은 다음 환경에서 호스팅되는 배포에서 사용할 수 있습니다.
- MongoDB Atlas: The fully managed service for MongoDB deployments in the cloud
참고
This command is supported in all MongoDB Atlas clusters. For information on Atlas support for all commands, see Unsupported Commands.
MongoDB Enterprise: MongoDB의 구독 기반 자체 관리 버전
MongoDB Community: MongoDB의 소스 사용 가능 무료 자체 관리 버전
구문
명령은 다음과 같은 구문을 가집니다:
db.runCommand( { connectionStatus: 1, showPrivileges: <boolean> } )
명령 필드
connectionStatus 다음과 같은 선택적 필드를 지원합니다.
필드 | 유형 | 설명 |
|---|---|---|
| 부울 | Optional. Set 기본적으로 이 필드는 |
예시
To run connectionStatus use the db.runCommand() method, as in the following:
db.runCommand( { connectionStatus: 1, showPrivileges: true } )
출력
connectionStatus.authinfo.authenticatedUserRoles현재 연결에 부여된 각 역할에 대한 문서가 있는 배열입니다.
connectionStatus.authinfo.authenticatedUserRoles[n].role현재 인증된 사용자와 연관된 현재 역할의 정의입니다. 자세한 내용은 기본 제공 역할 및 권한 작업을 참조하세요.
connectionStatus.authinfo.authenticatedUserRoles[n].dbThe database to which
roleapplies.
connectionStatus.authInfo.authenticatedUserPrivileges현재 연결에 부여된 조치를 설명하는 문서가 리소스별로 그룹화된 배열입니다.
connectionStatus.authInfo.authenticatedUserPrivileges[n].resourceA document describing the database and, if applicable, collection to which
connectionStatus.authInfo.authenticatedUserPrivileges[n].actionsapplies.