Docs HomeMongoDB Manual

Sharding Commands

Note

For details on a specific command, including syntax and examples, click on the link to the command's reference page.

NameDescription
abortReshardCollectionAborts a resharding operation.
New in version 5.0.
addShardAdds a shard to a sharded cluster.
addShardToZoneAssociates a shard with a zone. Supports configuring zones in sharded clusters.
balancerCollectionStatusReturns information on whether the chunks of a sharded collection are balanced.
New in version 4.4.
balancerStartStarts a balancer thread.
balancerStatusReturns information on the balancer status.
balancerStopStops the balancer thread.
checkShardingIndexInternal command that validates index on shard key.
clearJumboFlagClears the jumbo flag for a chunk.
cleanupOrphanedRemoves orphaned data with shard key values outside of the ranges of the chunks owned by a shard.
cleanupReshardCollectionCleans up a failed resharding operation.
New in version 5.0.
commitReshardCollectionForces a resharding operation to block writes and complete.
New in version 5.0.
configureCollectionBalancingConfigures balancer settings on a sharded collection.
New in version 5.3.
enableShardingCreates a database.
flushRouterConfigForces a mongod / mongos instance to update its cached routing metadata.
getShardMapReturns the hostnames and connection strings for shards in the cluster and the config servers for your 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.
moveRangeMigrates ranges between shards.
mergeChunksProvides the ability to combine chunks on a single shard.
refineCollectionShardKeyRefines a collection's shard key by adding a suffix to the existing key.
New in version 4.4.
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.
reshardCollectionInitiates a resharding operation to change the shard key for a collection, changing the distribution of your data.
New in version 5.0.
setAllowMigrationsPrevents the start of new automatic migrations on a collection, prevents in-flight manual migrations from committing, and excludes the collection from new balancer rounds.
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.
splitVectorInternal command that determines split points.
unsetShardingRemoved in MongoDB 5.0. Internal 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.