Split Chunks in a Sharded Cluster MongoDB Documentation, Release 3.0.4 for ( var x=97; x<97+26; x++ ){ for ( var y=97; y<97+26; y+=6 ) { var prefix = String.fromCharCode(x) + String.fromCharCode(y); db.runCommand( { split : "myapp.users" , middle : { email : prefix } } ); } } This assumes a collection size of 100 million documents. For information on the balancer and automatic distribution of chunks across shards, see Cluster Balancer (page 684) and Chunk Migration (page 685). For information on manually migrating chunks, see Migrate Chunks in a Sharded Cluster (page 724). Normally, MongoDB splits a chunk after an insert if the chunk exceeds the maximum chunk size (page 688). However, you may want to split chunks manually if: Note: New in version 2.6: MongoDB provides the mergeChunks command to combine contiguous chunk ranges into a single chunk. See Merge Chunks in a Sharded Cluster (page 725) for more information. The balancer may migrate recently split chunks to a new shard immediately if mongos predicts future insertions will benefit from the move. The balancer does not distinguish between chunks split manually and those split automatically by the system. 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. Use sh.status() to determine the current chunk ranges across the cluster. To split chunks manually, use the split command with either fields middle or find . The mongo shell provides the helper methods sh.splitFind() and sh.splitAt() . splitFind() splits the chunk that contains the first document returned that matches this query into two equally sized chunks. You must specify the full namespace (i.e. “ <database>.<collection> ”) of the sharded collection to splitFind() . The query in splitFind() does not need to use the shard key, though it nearly always makes sense to do so. The following command splits the chunk that contains the value of 63109 for the zipcode field in the people collection of the records database: sh.splitFind( "records.people", { "zipcode": "63109" } ) Example 723 10.3. Sharded Cluster Tutorials • you expect to add a large amount of data that would initially reside in a single chunk or shard. For example, you plan to insert a large amount of data with shard key values between 300 and 400 , but all values of your shard keys are between 250 and 500 are in a single chunk. • you have a large amount of data in your cluster and very few chunks , as is the case after deploying a cluster using existing data.