Sharding Commands

Note

For details on specific commands, including syntax and examples,click on the specific command to go to its reference page.

NameDescription
addShardAdds a shard to a sharded cluster.
addShardToZoneAssociates a shard with a zone. Supports configuring zones in sharded clusters.
balancerStartStarts a balancer thread.
balancerStatusReturns information on the balancer status.
balancerStopStops the balancer thread.
checkShardingIndexInternal command that validates index on shard key.
cleanupOrphanedRemoves orphaned data with shard key values outside of the ranges of the chunks owned by a shard.
enableShardingEnables sharding on a specific database.
flushRouterConfigForces a mongod/mongos instance to update its cached routing metadata.
getShardMapInternal command that reports on the state of a sharded cluster.
getShardVersionInternal command that returns the config server version.
isdbgridVerifies that a process is a mongos.
listShardsReturns a list of configured shards.
medianKeyDeprecated internal command. See splitVector.
moveChunkInternal command that migrates chunks between shards.
movePrimaryReassigns the primary shard when removing a shard from a sharded cluster.
mergeChunksProvides the ability to combine chunks on a single shard.
removeShardStarts the process of removing a shard from a sharded cluster.
removeShardFromZoneRemoves the association between a shard and a zone. Supports configuring zones in sharded clusters.
setShardVersionInternal command to sets the config server version.
shardCollectionEnables the sharding functionality for a collection, allowing the collection to be sharded.
shardingStateReports whether the mongod is a member of a sharded cluster.
splitCreates a new chunk.
splitChunkInternal command to split chunk. Instead use the methods sh.splitFind() and sh.splitAt().
splitVectorInternal command that determines split points.
unsetShardingInternal command that affects connections between instances in a MongoDB deployment.
updateZoneKeyRangeAdds or removes the association between a range of sharded data and a zone. Supports configuring zones in sharded clusters.