定义
refreshSessionsThe
refreshSessionscommand updates the last use time for the specified sessions, thereby extending the active state of the sessions.
兼容性
此命令可用于以下环境中托管的部署:
- MongoDB Atlas:用于云中 MongoDB 部署的完全托管服务
注意
所有 MongoDB Atlas 集群都支持此命令。有关 Atlas 对所有命令的支持的信息,请参阅不支持的命令。
MongoDB Enterprise:基于订阅、自我管理的 MongoDB 版本
MongoDB Community:源代码可用、免费使用且可自行管理的 MongoDB 版本
语法
该命令具有以下语法:
db.runCommand( { refreshSessions: [ { id : <UUID> }, ... ] } )
To run refreshSessions, use the db.runCommand( { <command> } ) method.
db.runCommand( { refreshSessions: [ { id : <UUID> }, ... ] } )
行为
会话识别
MongoDB concatenates each of the specified UUIDs with the hash of the authenticated user credentials to identify the user's sessions to refresh. If the user has no session that match, the refreshSessions has no effect.
访问控制
If the deployment enforces authentication/authorization, you must be authenticated to run the refreshSessions command.
用户只能刷新属于该用户的会话。