endSessions

On this page本页内容

Definition定义

endSessions

The endSessions command expires the specified sessions. endSessions命令使指定的会话过期。The command overrides the timeout period that sessions wait before expiring.该命令覆盖会话在过期之前等待的超时时间。

endSessions has the following syntax:具有以下语法:

{ endSessions: [ { id : <UUID> }, ... ] } )

To run endSessions, use the db.runCommand( { <command> } ) method.要运行endSessions,请使用db.runCommand( { <command> } )方法。

db.runCommand( { endSessions: [ { id : <UUID> }, ... ] } )

Behavior行为

Session Identification会话标识

MongoDB concatenates each of the specified UUIDs with the hash of the authenticated user credentials to identify the user's sessions to end. MongoDB将每个指定的UUID与经过身份验证的用户凭据的哈希连接起来,以标识要结束的用户会话。If the user has no session that match, the endSessions has no effect.如果用户没有匹配的会话,则endSessions无效。

Access Control访问控制

If the deployment enforces authentication/authorization, you must be authenticated to run the endSessions command.如果部署强制执行身份验证/授权,则必须对您进行身份验证才能运行endSessions命令。

A user can only end sessions belonging to the user.用户只能结束属于该用户的会话。

Tip提示
See also: 参阅:
←  commitTransactionkillAllSessions →