On this page本页内容
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> }, ... ] } )
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
无效。
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.用户只能结束属于该用户的会话。