定義
sh.enableMigrations(namespace)Enables migrations for the specified namespace of the sharded collection, but does not start chunk migrations. The balancer includes the collection you pass to
sh.enableMigrations()in migration operations the next time it runs. For more information on chunk migrations, see Manage Sharded Cluster Balancer.重要
You can only run
sh.enableMigrations()on amongosinstance. If you runsh.enableMigrations()on amongodinstance, the method returns an error.The
sh.enableMigrations()method has the following parameter:Parameterタイプ説明namespacestring
コレクションの名前空間。
互換性
このメソッドは、次の環境でホストされている配置で使用できます。
MongoDB Enterprise: サブスクリプションベースの自己管理型 MongoDB バージョン
MongoDB Community: ソースが利用可能で、無料で使用できる自己管理型の MongoDB のバージョン
注意
移行ステータスを確認するには、sh.status() を使用します。これにより、各コレクションの allowMigrationsフィールドが表示されます。