mongocli cloud-manager performanceAdvisor namespaces list
The performanceAdvisor namespaces list
command
retrieves a list of collection namespaces experiencing slow
queries for a specified host. Each namespace includes the database
name, the dot (.
) separator, and the collection name
(e.g. <database>.<collection>
).
Syntax
mongocli cloud-manager|cm performanceadvisor|performanceAdvisor namespaces list|ls --hostId <host-id> [ --since <unix-epoch-timestamp> ] [ --duration <milliseconds> ] [ --output|-o <output-format> ] [ --profile|-P <profile-name> ] [ --projectId <project-ID> ]
Note
Use -h
or --help
to view the command-line help for
this command.
Options
Option | Type | Description | Required? |
---|---|---|---|
--hostId | string | The unique identifier of the host of a MongoDB process. | yes |
--since | integer | Point in time, specified as a timestamp in the number of milliseconds that have elapsed since the UNIX epoch, from which you
want to retrieve results. | no |
--duration | string | Length of time from the since parameter, in milliseconds,
for which you want to retrieve results. | no |
--output , -o | string | Command output format. Valid values are:
If omitted, the command returns output in the default format. | no |
--profile , -P | string | Name of the profile where the public and private
keys for the project are saved. If omitted, uses the
default profile. To learn more about creating a
profile, see Configure the MongoDB CLI. | no |
--projectId | string | Unique identifier of the project. If omitted, uses the project ID in the profile or environment variable. | no |
Output
If the command succeeds, it returns the following output in the default format. If the command returns errors, see Troubleshooting for recommended solutions.
NAMESPACE TYPE <database>.<collection> collection
The default output is a subset of the fields returned by this command. For the complete list of JSON fields returned by the command, see the Public API reference for your MongoDB service:
Example
The following command retrieves the namespaces for collections experiencing slow queries for a project using the default profile, which contains credentials to access the project and the project ID. The output is returned in the default format.
mongocli cm performanceAdvisor namespaces list --hostId 78b0e5ae329f98047bddeac69ab40bc5
The previous command prints the following to the terminal.
NAMESPACE TYPE sample_weatherdata.data collection sample_mflix.movies collection sample_analytics.transactions collection sample_training.grades collection sample_training.companies collection sample_restaurants.neighborhoods collection sample_training.inspections collection sample_training.posts collection sample_airbnb.listingsAndReviews collection
The following command retrieves the namespaces for collections experiencing slow queries for a project using the default profile, which contains credentials to access the project and the project ID. The output is returned in JSON format.
mongocli cm performanceAdvisor namespaces list --hostId 78b0e5ae329f98047bddeac69ab40bc5 --output json
The previous command prints the following to the terminal in JSON format.
{ "namespaces": [ { "namespace": "sample_weatherdata.data", "type": "collection" }, { "namespace": "sample_airbnb.listingsAndReviews", "type": "collection" }, { "namespace": "sample_mflix.movies", "type": "collection" }, { "namespace": "sample_training.posts", "type": "collection" }, { "namespace": "sample_training.inspections", "type": "collection" }, { "namespace": "sample_restaurants.neighborhoods", "type": "collection" }, { "namespace": "sample_training.grades", "type": "collection" }, { "namespace": "sample_analytics.transactions", "type": "collection" }, { "namespace": "sample_training.companies", "type": "collection" } ] }