sh.enableAutoMerger()
On this page本页内容
Definition定义
sh.enableAutoMerger(namespace)
New in version 7.0. 7.0版新增。
Enables automatic chunk merges for a namespace.启用命名空间的自动块合并。
sh.enableAutoMerger() is a 是一个mongosh helper method. mongosh辅助方法。It is effectively the same as running the 这实际上与在configureCollectionBalancing command with the enableAutoMerger field set to true.enableAutoMerger字段设置为true的情况下运行configureCollectionBalancing命令相同。
mongosh Method
This page documents a mongosh method. This is not the documentation for database commands or language-specific drivers, such as Node.js.
For the database command, see the configureCollectionBalancing command.
For MongoDB API drivers, refer to the language-specific MongoDB driver documentation.
For the legacy mongo shell documentation, refer to the documentation for the corresponding MongoDB Server release:
Syntax语法
sh.enableAutoMerger( <namespace> )
Method Field方法字段
The method takes the following field:该方法采用以下字段:
namespace | String | "<database>.<collection>". Method enables automatic chunk merges for the supplied namespace."<database>.<collection>"的命名空间。方法为所提供的命名空间启用自动块合并。 |
Behavior行为
To set the time intervals for automatic chunk merges, use these parameters:要设置自动块合并的时间间隔,请使用以下参数:
Example实例
The following example enables automatic chunk merges for 以下示例为"testDatabase.myCollection". "testDatabase.myCollection"启用了自动块合并。Run the example from 运行mongos:mongos中的示例:
sh.enableAutoMerger( "testDatabase.myCollection" )
Learn More了解更多信息
The AutoMerger自动合并sh.disableAutoMerger()method方法sh.startAutoMerger()method方法sh.stopAutoMerger()method方法
configureCollectionBalancingcommand命令mergeAllChunksOnShardcommand命令autoMergerIntervalSecsparameter参数autoMergerThrottlingMSparameter参数