endSessions
定義
endSessions
endSessions
コマンドは、セッションを期限切れとしてマークし、セッションをクリーンアップして、セッションの有効期限を更新します。 コマンドは、セッションが期限切れになる前に待機するタイムアウト期間を上書きします。注意
セッションを直ちに終了して削除するには、
killSessions
コマンドを使用します。
互換性
このコマンドは、次の環境でホストされている配置で使用できます。
MongoDB Atlas はクラウドでの MongoDB 配置のためのフルマネージド サービスです
注意
This command is supported in all MongoDB Atlas clusters. For information on Atlas support for all commands, see Unsupported Commands.
MongoDB Enterprise: サブスクリプションベースの自己管理型 MongoDB バージョン
MongoDB Community: ソースが利用可能で、無料で使用できる自己管理型の MongoDB のバージョン
構文
このコマンドの構文は、次のとおりです。
db.runCommand( { endSessions: [ { id : <UUID> }, ... ] } )
endSessions
を実行するには、 db.runCommand( { <command> } )
メソッドを使用します。
db.runCommand( { endSessions: [ { id : <UUID> }, ... ] } )
動作
セッション識別
MongoDB は、指定された各 UUID を認証されたユーザー認証情報のハッシュと連結して、終了するユーザーのセッションを識別します。 ユーザーに一致するセッションが ない 場合、 endSessions
は効果がありません。
アクセス制御
配置で認証/承認が強制される場合、 endSessions
コマンドを実行するには認証が必要です。
ユーザーは、ユーザーに属するセッションのみを終了できます。