Easily find issues by searching: #<Issue ID>
Example: #1832
Easily find members by searching in: <username>, <first name> and <last name>.
Example: Search smith, will return results smith and adamsmith
Aqua Data Studio / nhilam |
Follow
824
|
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.
Contents
SHOW DATABASES
List all available databases.
Example
SHOW DATABASES
SHOW COLLECTIONS [IN <database_name>] [FOR COLLECTION <collection_name>] [NAMES_ONLY]
List collections of the indicated database.
If database_name is not specified, this command will list the collections in the current database.
The NAMES_ONLY option retrieves the collection name only and the storage data is not included in the result set.
Example
SHOW COLLECTIONS IN statistics
SHOW VIEWS [IN <database_name>] [FOR VIEW <view_name>] [NAMES_ONLY] New in 19.0
List views of the indicated database.
If database_name is not specified, this command will list the views in the current database.
The NAMES_ONLY option retrieves the view name only and the options data is not included in the result set.
Example
SHOW VIEWS IN statistics
SHOW FIELDS IN <collection_name> [IN <database_name>]
List all of the fields of the indicated database and collection.
If database_name is not specified, this command defaults to the current database.
Example
SHOW FIELDS IN baseballstats IN statistics
SHOW INDEXES [IN <database_name>] [FOR COLLECTION <collection_name>]
List all of the indexes for the indicated database and collection.
If collection_name is not specified, this command will list all the indexes in the indicated database.
If database_name is not specified, this command defaults to the current database.
Example
SHOW INDEXES IN statistics FOR COLLECTION baseballstats
SHOW INDEXFIELDS IN collection_name [IN <database_name>] [FOR INDEX <index_name>]
List all of the index fields for the indicated database, collection and index.
If database_name is not specified, this command defaults to the current database.
Example
SHOW INDEXFIELDS IN baseballstats IN statistics FOR INDEX batter_id_index
SHOW USERS [IN <database_name>] [FOR USER <user_name>]
List users of the indicated database and describe their USER_PERMISSIONS.
If database_name is not specified, this command defaults to the current database.
Example
SHOW USERS IN statistics
SHOW ROLES [IN <database_name>] [FOR USER <role_name>]
List the roles in the current database or the specified database. This is equivalent to MongoDB's db.runCommand({rolesInfo}) command.
If database_name is not specified, this command defaults to the current database. The following columns are displayed for SHOW ROLE: role, db, isBuiltin, roles, inheritedRoles, privileges, inheritedPrivileges
The SHOW ROLES command is only available in MongoDB 2.6 and newer.
Example
SHOW ROLES IN mydatabase
Example
SHOW ROLES FOR ROLE myrole
SHOW STATUS
Display server status. This is equivalent to the MongoDB's db.serverStatus() command.
The SHOW STATUS command will only work if you are an "admin" user. In MongoDB version 2.2, you need to be able to log in to the "admin" database. In MongoDB version 2.4, you need to have the clusterAdmin role in the "admin" database.
Example
SHOW 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.
The SHOW RS_STATUS command will only work if you are an "admin" user. In MongoDB version 2.2, you need to be able to log in to the "admin" database. In MongoDB version 2.4, you need to have the clusterAdmin role in the "admin" database.
Example
SHOW RS_STATUS
SHOW SH_STATUS
Display the list of shards in a sharded cluster. This is equivalent to the MongoDB's listShards command.
The SHOW SH_STATUS command will only work if you are an "admin" user. In MongoDB version 2.2, you need to be able to log in to the "admin" database. In MongoDB version 2.4, you need to have the clusterAdmin role in the "admin" database.
Example
SHOW SH_STATUS
About AquaClusters Privacy Policy Support Version - 19.0.2-4 AquaFold, Inc Copyright © 2007-2017
System Variables - see comments https://www.aquaclusters.com/app/home/project/public/aquadatastudio/issue/8128
System Variables - see comments https://www.aquaclusters.com/app/home/project/public/aquadatastudio/issue/8128
See comments for Show status - https://www.aquaclusters.com/app/home/project/public/aquadatastudio/issue/8961
See comments for Show status - https://www.aquaclusters.com/app/home/project/public/aquadatastudio/issue/8961
(in a future installer, will test when that is created)
In order to take the current database context for the SHOW commands, we'll change the syntax to allow the database name to be an optional parameter.
Also, to retrieve the storage data for a collection for the Collection Dialog, we need to enhance the SHOW COLLECTIONS command to return the collection meta data for a specified collection. We'll add an optional FOR COLLECTION parameter.
SHOW DATABASES
SHOW COLLECTIONS [IN db_name] [FOR COLLECTION collection_name]
SHOW FIELDS IN collection_name [IN db_name]
SHOW INDEXES [IN db_name] [FOR COLLECTION collection_name]
SHOW INDEXFIELDS IN collection_name [IN db_name] [FOR INDEX index_name]
SHOW USERS [IN db_name] [FOR USER user_name]
(in a future installer, will test when that is created)
In order to take the current database context for the SHOW commands, we'll change the syntax to allow the database name to be an optional parameter.
Also, to retrieve the storage data for a collection for the Collection Dialog, we need to enhance the SHOW COLLECTIONS command to return the collection meta data for a specified collection. We'll add an optional FOR COLLECTION parameter.
SHOW DATABASES
SHOW COLLECTIONS [IN db_name] [FOR COLLECTION collection_name]
SHOW FIELDS IN collection_name [IN db_name]
SHOW INDEXES [IN db_name] [FOR COLLECTION collection_name]
SHOW INDEXFIELDS IN collection_name [IN db_name] [FOR INDEX index_name]
SHOW USERS [IN db_name] [FOR USER user_name]