AI エージェント向け: ドキュメントインデックスは https://www.mongodb.com/ja-jp/docs/llms.txt で利用できます。すべてのページの markdown バージョンは、いずれかの URL パスに .md を追加することで利用できます。
Docs Menu

sh.enableMigrations()(mongoshメソッド)

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 a mongos instance. If you run sh.enableMigrations() on a mongod instance, the method returns an error.

The sh.enableMigrations() method has the following parameter:

Parameter
タイプ
説明

namespace

string

コレクションの名前空間

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

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

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

注意

移行ステータスを確認するには、sh.status() を使用します。これにより、各コレクションの allowMigrationsフィールドが表示されます。

このページを評価

項目一覧