Docs Menu
Docs Home
/
MongoDB マニュアル
/ / /

setAllowMigrations

項目一覧

  • 定義
  • 構文
  • コマンドフィールド
  • 動作
setAllowMigrations

コレクションで新しい移行の自動開始を防ぎ、進行中の手動移行がコミットされないようにし、コレクションを新しいバランサー ラウンドから除外します。

このコマンドの構文は、次のとおりです。

db.adminCommand(
{
setAllowMigrations: "<db>.<collection>",
allowMigrations: <true|false>
}
)

コマンドは、次のパラメーターを取ります。

フィールド
タイプ
説明
setAllowMigrations
string

変更するコレクション。

boolean

false場合:

  • MongoDB がコレクションで新規の自動移行を防止します

  • 進行中の手動移行はコミットされません

  • コレクションは新しいバランサー ラウンドから除外されます

true場合:

  • MongoDB でコレクションで新たな自動移行が可能になります

  • 移動中の手動移行がコミットされる

  • コレクションは新しいバランサー ラウンドに含まれます

setAllowMigrationsにはmoveChunkと同じ特権が必要です。

この操作により、 store.inventoryコレクションでの移行を防止できます。

db.adminCommand( {
setAllowMigrations: "store.inventory",
allowMigrations: false
} )

戻る

reshardCollection