sh.enableAutoSplit
On this page
MongoDB 5.0 is end of life as of October 2024. This version of the documentation is no longer
supported. To upgrade your 5.0 deployment, see the MongoDB 6.0 upgrade procedures.
Description
sh.enableAutoSplit()
New in version 3.4.
Enables auto-splitting for the sharded cluster. Auto-splitting is enabled by default.
sh.enableAutoSplit()
enables the autosplit flag in theconfig.settings
collection.You can only run
sh.enableAutoSplit()
from amongosh
session that is connected to amongos
instance.sh.enableAutoSplit()
errors if run on amongod
instance.Note
Starting in MongoDB 4.2,
sh.startBalancer()
also enables auto-splitting for the sharded cluster.For more information on chunk splits, see Chunk Splits. For more information about how MongoDB balances chunks among shards, see: Manage Sharded Cluster Balancer and Sharded Cluster Balancer.