Docs Menu
Docs Home
/ /
MongoDB Command Line Interface
/ / /

mongocli atlas performanceAdvisor namespaces list

On this page

  • Syntax
  • Options
  • Output
  • Example

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>).

mongocli atlas performanceadvisor|performanceAdvisor namespaces list|ls
--processName <host-name>
[ --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.

Option
Type
Description
Required?
--processName
string
The unique identifier of the host of a MongoDB process in the following format: {hostname}:{port}.
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:

  • json for output in JSON format

  • go-template for custom output using the Go template

  • go-template-file for custom output specified using Go template file

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

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:

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 atlas performanceAdvisor namespaces list --processName atlas-111ggi-shard-00-00.111xx.mongodb.net:27017

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 atlas performanceAdvisor namespaces list --processName atlas-111ggi-shard-00-00.111xx.mongodb.net:27017 --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"
}
]
}

Back

Performance Advisor