翻译或纠错本页面

listShards

On this page

Definition

listShards

Returns a list of the configured shards. listShards is only available for mongos instances. You can only issue listShards against the admin database.

The command takes the following form:

{ listShards: 1 }

Example

The following example returns the list of shards:

db.getSiblingDB("admin").runCommand( { listShards: 1 } )