- Reference >
- Database Commands >
- shardingState
shardingState¶
-
shardingState
¶ shardingState
is an admin command that reports ifmongod
is a member of a sharded cluster.shardingState
has the following prototype form:For
shardingState
to detect that amongod
is a member of a sharded cluster, themongod
must satisfy the following conditions:- the
mongod
is a primary member of a replica set, and - the
mongod
instance is a member of a sharded cluster.
If
shardingState
detects that amongod
is a member of a sharded cluster,shardingState
returns a document that resembles the following prototype:Otherwise,
shardingState
will return the following document:The response from
shardingState
when used with a config server is:Note
mongos
instances do not provide theshardingState
.Warning
This command obtains a write lock on the affected database and will block other operations until it has completed; however, the operation is typically short lived.
- the