Definition
splitChunkAn internal administrative command. To split chunks, use the
sh.splitFind()andsh.splitAt()functions in themongoshell.Warning
Be careful when splitting data in a sharded collection to create new chunks. When you shard a collection that has existing data, MongoDB automatically creates chunks to evenly distribute the collection. To split data effectively in a sharded cluster you must consider the number of documents in a chunk and the average document size to create a uniform chunk size. When chunks have irregular sizes, shards may have an equal number of chunks but have very different data sizes. Avoid creating splits that lead to a collection with differently sized chunks.
The
splitChunkcommand takes a document with the following fields:FieldTypeDescriptionnsstring
keyPatterndocument
The shard key.
mindocument
The lower bound of the shard key for the chunk to split.
maxdocument
The upper bound of the shard key for the chunk to split.
fromstring
The shard that owns the chunk to split.
splitKeysdocument
The split point for the chunk.
shardIddocument
The shard.