splitChunk

Definition

Warning

Be careful when splitting data in a sharded collection to createnew chunks. When you shard a collection that has existing data,MongoDB automatically creates chunks to evenly distribute thecollection. To split data effectively in a sharded cluster you mustconsider the number of documents in a chunk and the averagedocument size to create a uniform chunk size. When chunks haveirregular sizes, shards may have an equal number of chunks but havevery different data sizes. Avoid creating splits that lead to acollection with differently sized chunks.

See also

moveChunk and sh.moveChunk().

The splitChunk command takes a document with the following fields:

FieldTypeDescriptionnsstringThe complete namespace of the chunk to split.keyPatterndocumentThe shard key.mindocumentThe lower bound of the shard key for the chunk to split.maxdocumentThe upper bound of the shard key for the chunk to split.fromstringThe shard that owns the chunk to split.splitKeysdocumentThe split point for the chunk.shardIddocumentThe shard.