On this page本页内容
commitReshardCollection
New in version 5.0.在版本5.0中新增。
During a resharding operation, MongoDB does not block writes until the estimated duration to complete the resharding operation is below two seconds.在重新发送操作期间,MongoDB不会阻止写入,直到完成重新发送操作的估计持续时间低于两秒。
If the current estimate is above two seconds but the time frame is acceptable to you, you can finish resharding faster. 如果当前的估计值超过两秒,但您可以接受时间范围,则可以更快地完成重新发货。The commitReshardCollection
command blocks writes early and forces the resharding operation to complete.commitReshardCollection
命令阻止早期写入,并强制重新加载操作完成。
The command has the following syntax:该命令具有以下语法:
{ commitReshardCollection: "<database>.<collection>" }
The mongosh
provides a wrapper method sh.commitReshardCollection()
.mongosh
提供了一个包装方法sh.commitReshardCollection()
。
The following command forces the resharding operation on the 以下命令强制对sales.orders
to block writes and complete:sales.orders
执行重新分片操作以阻止写入并完成:
db.adminCommand({ commitReshardCollection: "sales.orders" })