connectionStatus

在本页面

Definition

{ connectionStatus: 1, showPrivileges: <boolean> }

connectionStatus支持以下可选字段:

Field Type Description
showPrivileges boolean 可选的。将showPrivileges设置为 true 可指示connectionStatus返回当前已认证用户拥有的privileges的完整集合。


默认情况下,此字段为false

Example

要运行connectionStatus,请使用db.runCommand()方法,如下所示:

db.runCommand( { connectionStatus: 1, showPrivileges: true } )

Output

首页