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:
フィールド | タイプ | 説明 |
---|---|---|
| The collection to modify. | |
|
|
動作
setAllowMigrations
requires the same privileges as
moveChunk
.
例
This operation prevents migrations on the store.inventory
collection:
db.adminCommand( { setAllowMigrations: "store.inventory", allowMigrations: false } )