Page History
The following SHOW commands can be used to describe MongoDB schema information. See the SQL Query Reference for information on Utility Statements and Configuration Functions.
Anchor | ||||||
---|---|---|---|---|---|---|
|
Table of Contents | ||
---|---|---|
|
SHOW DATABASES
SHOW DATABASES
List all available databases.
Example
Code Block |
---|
SHOW DATABASES |
...
SHOW COLLECTIONS
SHOW COLLECTIONS [IN <database_name>] [FOR COLLECTION <collection_name>] [NAMES_ONLY]
...
Code Block |
---|
SHOW COLLECTIONS IN statistics |
SHOW VIEWS
SHOW VIEWS [IN <database_name>] [FOR VIEW <view_name>] [NAMES_ONLY] New in 19.0
...
Code Block |
---|
SHOW VIEWS IN statistics |
SHOW FIELDS
SHOW FIELDS IN <collection_name> [IN <database_name>]
...
Code Block |
---|
SHOW FIELDS IN baseballstats IN statistics |
SHOW INDEXES
SHOW INDEXES [IN <database_name>] [FOR COLLECTION <collection_name>]
...
Code Block |
---|
SHOW INDEXES IN statistics FOR COLLECTION baseballstats |
...
SHOW INDEXFIELDS
SHOW INDEXFIELDS IN collection_name [IN <database_name>] [FOR INDEX <index_name>]
...
Code Block |
---|
SHOW INDEXFIELDS IN baseballstats IN statistics FOR INDEX batter_id_index |
SHOW USERS
SHOW USERS [IN <database_name>] [FOR USER <user_name>]
...
Code Block |
---|
SHOW USERS IN statistics |
SHOW ROLES
SHOW ROLES [IN <database_name>] [FOR USER <role_name>]
...
Code Block |
---|
SHOW ROLES FOR ROLE myrole |
SHOW STATUS
SHOW STATUS
Display server status. This is equivalent to the MongoDB's db.serverStatus() command.
...
Example
Code Block |
---|
SHOW STATUS |
SHOW RS_STATUS
SHOW RS_STATUS
Display the list of members in a replica set. This is equivalent to members field returned from the MongoDB's replSetGetStatus command.
...
Example
Code Block |
---|
SHOW RS_STATUS |
...
SHOW SH_STATUS
SHOW SH_STATUS
Display the list of shards in a sharded cluster. This is equivalent to the MongoDB's listShards command.
...
Example
Code Block |
---|
SHOW SH_STATUS |