On this page本页内容
sh.commitReshardCollection(namespace)
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 sh.commitReshardCollection()
method blocks writes early and forces the resharding operation to complete.sh.commitReshardCollection()
方法会阻止提前写入,并强制完成重新存储操作。
The mongosh
method sh.commitReshardCollection()
wraps the commitReshardCollection
command.mongosh
方法sh.commitReshardCollection()
包装了commitReshardCollection
命令。
The sh.commitReshardCollection()
method has the following syntax:sh.commitReshardCollection()
方法具有以下语法:
sh.commitReshardCollection( <namespace> )
The sh.commitReshardCollection()
method takes the following parameter:sh.commitReshardCollection()
方法采用以下参数:
namespace | String |
|
The following command forces the resharding operation on the 以下命令强制sales.orders
to block writes and complete:sales.orders
上的重新分片操作阻止写入并完成:
sh.commitReshardCollection("sales.orders")