Navigation

Sharding Commands

Note

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

Name Description
abortReshardCollection

Aborts a resharding operation.

New in version 5.0.

addShard Adds a shard to a sharded cluster.
addShardToZone Associates a shard with a zone. Supports configuring zones in sharded clusters.
balancerCollectionStatus

Returns information on whether the chunks of a sharded collection are balanced.

New in version 4.4.

balancerStart Starts a balancer thread.
balancerStatus Returns information on the balancer status.
balancerStop Stops the balancer thread.
checkShardingIndex Internal command that validates index on shard key.
clearJumboFlag Clears the jumbo flag for a chunk.
cleanupOrphaned Removes orphaned data with shard key values outside of the ranges of the chunks owned by a shard.
cleanupReshardCollection

Cleans up a failed resharding operation.

New in version 5.0.

commitReshardCollection

Forces a resharding operation to block writes and complete.

New in version 5.0.

configureCollectionBalancing

Configures balancer settings on a sharded collection.

New in version 5.3.

enableSharding Creates a database.
flushRouterConfig Forces a mongod/mongos instance to update its cached routing metadata.
getShardMap Internal command that reports on the state of a sharded cluster.
getShardVersion Internal command that returns the config server version.
isdbgrid Verifies that a process is a mongos.
listShards Returns a list of configured shards.
medianKey Deprecated internal command. See splitVector.
moveChunk Internal command that migrates chunks between shards.
movePrimary Reassigns the primary shard when removing a shard from a sharded cluster.
mergeChunks Provides the ability to combine chunks on a single shard.
refineCollectionShardKey

Refines a collection’s shard key by adding a suffix to the existing key.

New in version 4.4.

removeShard Starts the process of removing a shard from a sharded cluster.
removeShardFromZone Removes the association between a shard and a zone. Supports configuring zones in sharded clusters.
reshardCollection

Initiates a resharding operation to change the shard key for a collection, changing the distribution of your data.

New in version 5.0.

setAllowMigrations Prevents the start of new automatic migrations on a collection, prevents in-flight manual migrations from committing, and excludes the collection from new balancer rounds.
setShardVersion Internal command to sets the config server version.
shardCollection Enables the sharding functionality for a collection, allowing the collection to be sharded.
shardingState Reports whether the mongod is a member of a sharded cluster.
split Creates a new chunk.
splitVector Internal command that determines split points.
unsetSharding Removed in MongoDB 5.0. Internal command that affects connections between instances in a MongoDB deployment.
updateZoneKeyRange Adds or removes the association between a range of sharded data and a zone. Supports configuring zones in sharded clusters.
Search Results
    Was this page helpful?