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

commitReshardCollection (データベースコマンド)

commitReshardCollection

バージョン 5.0 の新機能。

commitReshardCollection は書込みを早期にブロックし、リシャーディング操作を強制的に完了させます。

リシャーディング操作中、 MongoDB はリシャーディング操作を完了するための推定期間が一定の値を下回るまで、書込みをブロックしません。MongoDB 8.0.12 以前では、この値は 2 秒です。MongoDB 8.0.13 以降では、この値は 500 ミリ秒です。

現在の推定期間がしきい値を超えているが、時間枠が許容できる場合は、commitReshardCollection を呼び出すとリシャーディングをより速く完了できます。これにより、書込みが早期にブロックされ、リシャーディング操作が強制的に完了します。

Tip

In mongosh, this command can also be run through the sh.commitReshardCollection() helper method.

Helper methods are convenient for mongosh users, but they may not return the same level of information as database commands. In cases where the convenience is not needed or the additional return fields are required, use the database command.

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

  • MongoDB Atlas: The fully managed service for MongoDB deployments in the cloud

注意

This command is supported in all MongoDB Atlas clusters. For information on Atlas support for all commands, see Unsupported Commands.

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

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

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

db.adminCommand(
{
commitReshardCollection: "<database>.<collection>"
}
)

The mongosh provides a wrapper method sh.commitReshardCollection().

次のコマンドは、 sales.ordersにリシャーディング操作を強制し、書込みをブロックして完了します。

db.adminCommand({
commitReshardCollection: "sales.orders"
})
このページを評価