Docs 菜单

refreshSessions

refreshSessions

The refreshSessions command updates the last use time for the specified sessions, thereby extending the active state of the sessions.

此命令可用于以下环境中托管的部署:

注意

所有 MongoDB Atlas 集群都支持此命令。有关 Atlas 对所有命令的支持的信息,请参阅不支持的命令

该命令具有以下语法:

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

要运行 refreshSessions,请使用 db.runCommand( { <command> } ) 方法。

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.

如果部署强制执行身份验证/授权,则您必须通过身份验证才能运行refreshSessions命令。

A user can only refresh sessions belonging to the user.

另请参阅: