Docs Menu

setAllowMigrations

setAllowMigrations

Prevents the start of new automatic migrations on a collection, prevents in-flight manual migrations from committing, and excludes the collection from new balancer rounds.

このコマンドは、次の環境でホストされている配置で使用できます。

  • MongoDB Atlas はクラウドでの MongoDB 配置のためのフルマネージド サービスです

重要

このコマンドはサーバーレスインスタンスではサポートされていません。 詳細については、「サポートされていないコマンド 」を参照してください。

  • MongoDB Enterprise: サブスクリプションベースの自己管理型 MongoDB バージョン

  • MongoDB Community: ソースが利用可能で、無料で使用できる自己管理型の MongoDB のバージョン

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

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

The command takes the following parameters:

フィールド
タイプ
説明

string

The collection to modify.

boolean

false場合:

true場合:

setAllowMigrations requires the same privileges as moveChunk.

This operation prevents migrations on the store.inventory collection:

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