Atlas Slow-Query Log and Performance Advisor Automation
Parent: MongoDB Query Optimization Tooling: Compass Explain, Atlas Query Insights and Performance Advisor · Published reference · snapshot 2026-10-19 · skill atlas-diagnostics-expert/references/mongodb-atlas-slow-query-and-advisor-automation.md
Also known as: Admin API listSuggestedIndexes automation, Atlas CLI/Admin API slow query log download, Atlas Performance Advisor MCP server access, Atlas Slow-Query Log and Performance Advisor Automation (managedSlowMs and Admin API listSuggestedIndexes and Atlas CLI), Atlas-managed slow operation threshold (managedSlowMs)
↓ Facts as markdownall context files
Atlas exposes Performance Advisor suggestions and slow query logs through Admin API v2 endpoints and the Atlas CLI (atlas api performanceAdvisor and atlas performanceAdvisor), scoped by process id with a default 24-hour window; managedSlowMs toggles the Atlas-managed dynamic slow threshold against a fixed 100 ms, and Project Read Only versus Project Owner roles gate reads and toggles. Compiled from Atlas documentation plus the run's verified claims.
These notes link each claim to its source. Some citations identify archived research reports that are no longer hosted on this site. A published reference means the content is available; it does not certify independent review or accuracy.Read the editorial policy and follow the sources before relying on a claim.
Definitions
- Since `{ a : 1 }` is a prefix of `{ a : 1, b : 1 }`, Performance Advisor suggests only `{ a : 1, b : 1 }`. To learn more about index prefixes, see [Prefixes.](https://www.mongodb.com/docs/manual/core/index-compound/#prefixes) [source]
- Since { a : 1 } is a prefix of { a : 1, b : 1 }, Performance Advisor suggests only { a : 1, b : 1 }. To learn more about index prefixes, see Prefixes. [source]
- - Query Shape Reports are not available through the Atlas Administration API. [source]
- For example, in the following document, `metadata` is a good choice of `metaField` since it makes it easy to query data from a given weather sensor. Using these fields, MongoDB buckets readings from a single sensor together. [source]
- If the mongod is a secondary, it drops the constraint violation table. Since the primary must successfully drain the constraint violation table prior to creating the "commitOplogEntry" oplog entry, the secondary can safely assume that no violations exist. [source]
- The RTPP is not available to monitor from the Atlas Administration API, but you can enable and disable the RTPP from the Atlas Administration API with [Update One Project Settings.](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-updateprojectsettings) [source]
- The $queryStats aggregation stage is unsupported and is not guaranteed to be stable in a future release. Don't build functionality that relies on a specific output format of this stage, since the output may change in a future release. [source]
- For instance, the inequality operators $nin and $ne are not very selective since they often match a large portion of the index. As a result, in many cases, a $nin or $ne query with an index may perform no better than a $nin or $ne query that must scan all documents in a collection. [source]
- - `slowms` is the **previous** [slowms](https://www.mongodb.com/docs/manual/reference/method/db.setprofilinglevel.md#std-label-set-profiling-level-options-slowms) setting. [source]
- - The `slowms` and `sampleRate` options are not used for profiling. [source]
Structure and components
- MongoDB updates process and audit logs from the cluster backend infrastructure every five minutes. Logs are stored in chunks approximately five minutes in length, but this duration may vary. If you poll the API for log files, we recommend polling every five minutes even though consecutive polls could contain some overlapping logs. This feature isn't available for M0 free clusters, M2, M5, flex, or serverless clusters. The API does not support direct calls with the json response schema. You must request a gzip response schema using an accept header of the format: Accept: application/vnd.atlas.Y [source]
- | Name | Type | Required | Description | | --- | --- | --- | --- | | --apiKey | string | false | Datadog API Key, Opsgenie API Key, or VictorOps API key. Required if the notificationType is DATADOG, OPS_GENIE, or VICTOR_OPS, respectively. | | --enabled | | false | Flag that indicates whether to enable the alert configuration. | | --event | string | false | Type of event that triggered the alert. To learn which values the CLI accepts, see the Enum for eventTypeName in the Atlas Admin API spec: [https://dochub.mongodb.org/core/atlas-event-names.](https://dochub.mongodb.org/core/atlas-event-name [source]
- Atlas provides the following default [Intelligent Workload Management](https://www.mongodb.com/docs/atlas/intelligent-workload-management.md#std-label-intelligent-workload-management) alerts for projects that contain Dedicated clusters running MongoDB 9.0 or later: [source]
- Each index that the Performance Advisor suggests contains the following metrics. These metrics apply specifically to queries which would be improved by the index: [source]
- - If `hasSort` is set to `true`, this indicates that the query contains a [`sort()`](https://www.mongodb.com/docs/manual/reference/method/cursor.sort.md#mongodb-method-cursor.sort) method. Unindexed [`sort()`](https://www.mongodb.com/docs/manual/reference/method/cursor.sort.md#mongodb-method-cursor.sort) methods can be very resource intensive. Check your search index configuration and confirm whether it supports the [`sort()`](https://www.mongodb.com/docs/manual/reference/method/cursor.sort.md#mongodb-method-cursor.sort) method. [source]
- In this example, sort order may be inconsistent, since the `borough` field contains duplicate values. Documents are returned in alphabetical order by `borough`, but the order of those documents with duplicate values for `borough` might not be the same across multiple executions of the same sort. [source]
- Since the `_id` field is always guaranteed to contain exclusively unique values, the returned sort order will always be the same across multiple executions of the same sort. [source]
- A document that contains the duration, in microseconds, of the completed or in-progress [`steps/state`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/currentop.md#mongodb-data--currentOp.twoPhaseCommitCoordinator.state) of the active process as well as the cumulative total duration; for example: [source]
- - The document with `_id` equal to `3` does not contain the `students` field in the result since no element in its `students` array matched the [`$elemMatch`](https://www.mongodb.com/docs/manual/reference/operator/projection/elemmatch.md#mongodb-projection-proj.-elemMatch) condition. [source]
- The document with `_id` equal to `3` does not contain the `students` field since no array element matched the [`$elemMatch`](https://www.mongodb.com/docs/manual/reference/operator/projection/elemmatch.md#mongodb-projection-proj.-elemMatch) criteria. [source]
- The index option `hidden` no longer appears as part of the `borough_1_ratings_1` index since the field is only returned if the value is `true`. [source]
- | Field | Description | | --- | --- | | `samplingRate` | The sampling rate used to mirror a subset of [operations that support mirroring](https://www.mongodb.com/docs/manual/replication.md#std-label-mirrored-reads-supported-operations) to a subset of electable (specifically, [`priority greater than 0`](https://www.mongodb.com/docs/manual/reference/replica-configuration.md#mongodb-rsconf-rsconf.members-n-.priority)) secondaries. That is, the primary mirrors reads to each electable secondary at the specified sampling rate. Valid values are: `0.0`Turns off mirroring.`1.0`The primary mirrors all [source]
- Atlas Search index contains the indexed fields and the analyzers used to create the index. To use this resource, the requesting API Key must have the Project Data Access Read Write role. [source]
- Since a missing key value is returned as part of a null equality match, to avoid updating a null-valued key, include additional query conditions (such as on the `_id` field) as appropriate. [source]
- The number of times that the assert counters have rolled over since the last time the MongoDB process started. The counters will roll over to zero after 2 30 assertions. Use this value to provide context to the other values in the [`asserts`](https://www.mongodb.com/docs/manual/reference/command/serverstatus.md#mongodb-serverstatus-serverstatus.asserts) data structure. [source]
- The total number of [`getMore`](https://www.mongodb.com/docs/manual/reference/command/getmore.md#mongodb-dbcommand-dbcmd.getMore) operations since the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) instance last started. This counter can be high even if the query count is low. Secondary nodes send [`getMore`](https://www.mongodb.com/docs/manual/reference/command/getmore.md#mongodb-dbcommand-dbcmd.getMore) operations as part of the replication process. [source]
- A document that contains counters tracking the number of times write-blocking is enabled with different reasons since the server started. [source]
- Starting in 9.0, MongoDB stores time series collections in single namespaces that contain the data compressed into organized groups, or [buckets](https://www.mongodb.com/docs/manual/core/timeseries/timeseries-bucketing.md#std-label-timeseries-bucketing-specifics). When you query a time series collection, MongoDB converts the data from its raw bucketed form to a logical form with one document per measurement. [source]
- - [atlas api monitoringAndLogs downloadClusterLog](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-monitoringandlogs-downloadclusterlog.md#std-label-atlas-api-monitoringAndLogs-downloadClusterLog) - Returns a compressed (.gz) log file that contains a range of log messages for the specified host for the specified project. [source]
- The [Query Profiler](https://www.mongodb.com/docs/atlas/tutorial/query-profiler.md#std-label-query-profiler) contains several metrics you can use to pinpoint specific inefficient queries. You can visualize up to the past 24 hours of query operations. The Query Profiler can show the Examined : Returned Ratio (index keys examined to documents returned) of logged queries, which might help you identify the queries that triggered a [`Query Targeting: Scanned / Returned`](https://www.mongodb.com/docs/atlas/reference/alert-conditions.md#mongodb-alert-Query-Targeting--Scanned---Returned) alert. The ch [source]
- The Query Profiler contains several metrics you can use to pinpoint specific inefficient queries. You can visualize up to the past 24 hours of query operations. The Query Profiler can show the Examined : Returned Ratio (index keys examined to documents returned) of logged queries, which might help you identify the queries that triggered a Query Targeting: Scanned / Returned alert. The chart shows the number of index keys examined to fulfill a query relative to the actual number of returned documents. [source]
How it works
- CLI naming varies by release: older/current pages show both listSuggestedIndexes (process-level) and listClusterSuggestedIndexes (cluster-level, takes processIds); Admin API v2 also has a separate Return All Suggested Indexes to Drop operation. Check the pinned CLI version before scripting. [source]
- When an index build completes, Atlas generates an [activity feed event](https://www.mongodb.com/docs/atlas/tutorial/activity-feed.md#std-label-view-activity-feed) and sends a notification email to the project owner with the following information: [source]
- Building an index in a rolling fashion reduces the resiliency of your cluster and increases index build times. We only recommend using rolling index builds when regular index builds do not meet your needs. [source]
- If you decide to continue with a rolling index, consider that they must meet certain conditions to succeed. To ensure your index build succeeds, avoid the following design patterns that commonly trigger a restart loop: [source]
- Atlas automatically cancels rolling index builds that don't succeed on all nodes. When a rolling index build completes on some nodes, but fails on others, Atlas cancels the build and removes the index from any nodes that it was successfully built on. [source]
- | Atlas Cluster Operations and Connection Metrics | Opcounters; Operation Execution Times; Query Executors and Query Targeting; Connections; Queues; Scan and Order | | --- | --- | | Hardware Metrics | Normalized System CPU; Normalized Process CPU; Disk Latency; Disk IOPS; Disk Space Free; System Memory; Swap Usage | | Replication Metrics | Replication Lag; Replication Oplog Window; Replication Headroom; Oplog GB/Hour; Opcounters -repl | [source]
- When Atlas determines that your schema or queries can be improved, it displays a performance insight. Performance insights show ways to improve your schema and data modeling practices. Use performance insights to learn best schema design practices and improve application performance. [source]
- These alerts help you track when Atlas automatically adjusts cluster resources in response to workload changes. To learn more about auto-scaling alerts and how to configure them, see [Fix Auto-Scaling Issues.](https://www.mongodb.com/docs/atlas/reference/alert-resolutions/atlas-autoscaling-alerts/) [source]
- Recommended indexes are accompanied by sample queries, grouped by [query shape](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-query-shape), that were run against a collection that would benefit from the suggested index. The Performance Advisor considers workload activity across all nodes in the replica set, including secondaries, when generating index recommendations. The Performance Advisor doesn't negatively affect the performance of your Atlas clusters. [source]
- Each index suggestion includes an Average Query Targeting score indicating how many documents were read for every document returned for the index's corresponding query shapes. A score of 1 represents very efficient query shapes because every document read matched the query and was returned with the query results. All suggested indexes represent an opportunity to improve query performance. [source]
- You can also adjust the time range the Performance Advisor takes into account when suggesting indexes by using the Time Range dropdown at the top of the Performance Advisor. [source]
- You can create [indexes](https://www.mongodb.com/docs/manual/core/indexes/) suggested by the Performance Advisor directly within the Performance Advisor itself. When you create indexes, keep the ratio of reads to writes on the target collection in mind. Indexes come with a performance cost, but are more than worth the cost for frequent queries on large data sets. To learn more about indexing strategies, see [Indexing Strategies.](https://www.mongodb.com/docs/manual/applications/indexes/) [source]
- - Create the indexes that the Performance Advisor suggests when they align with your [Indexing Strategies.](https://www.mongodb.com/docs/manual/applications/indexes/) [source]
- You can create indexes suggested by the Performance Advisor directly within the Performance Advisor itself. When you create indexes, keep the ratio of reads to writes on the target collection in mind. Indexes come with a performance cost, but are more than worth the cost for frequent queries on large data sets. To learn more about indexing strategies, see Indexing Strategies. [source]
- Auto-scaling events, including both reactive and predictive auto-scaling actions, are logged in the Activity Feed. Filter these events to distinguish between reactive scaling that current resource usage triggers and predictive scaling that forecasted cyclical demand patterns trigger. This visibility helps you understand when and why Atlas adjusts cluster resources automatically. [source]
- Returns the Atlas Search hardware and status data series within the provided time range for one process in the specified project. [source]
- The [default](https://www.mongodb.com/docs/atlas/configure-alerts.md#std-label-default-alert-settings) [`Query Targeting: Scanned Objects / Returned`](https://www.mongodb.com/docs/atlas/reference/alert-conditions.md#mongodb-alert-Query-Targeting--Scanned-Objects---Returned) alert ratio differs slightly. The ratio of the average number of documents scanned to the average number of documents returned during a sampling period triggers this alert. [source]
- Because the duration of the removal operation depends on the workload of your [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) instance, expired data may exist for some time *beyond* the 60 second period between runs of the background task. [source]
- For every encrypted collection, MongoDB creates [two metadata collections](https://www.mongodb.com/docs/manual/core/queryable-encryption/fundamentals/manage-collections.md#std-label-qe-metadata-collections), increasing storage space. MongoDB creates an index for each encrypted field, which increases the duration of write operations on that field. When a write operation updates an indexed field, MongoDB updates the related index. [source]
- For featureCompatibilityVersion "4.0", createIndexes uses the pre-4.2 index build process which by default obtains an exclusive lock on the parent database for the entire duration of the build process. The pre-4.2 build process blocks all operations on the database and all its collections until the operation completed. background indexes do not take an exclusive lock. [source]
- Index filters exist for the duration of the server process and do not persist after shutdown. MongoDB also provides a command to manually remove filters. [source]
- Turn the toggle on to subscribe or off to unsubscribe. When subscribing for the first time, select the cluster or clusters that you want the report to cover. The change applies to all [`Project Owner`](https://www.mongodb.com/docs/atlas/reference/user-roles.md#mongodb-authrole-Project-Owner) users in the project. [source]
- For example, in a collection with six encrypted fields, you can reduce the size of the `ESC` by at least 1000 documents when total documents inserted and unique field/value pairs inserted since the last compaction meet the following conditions: [source]
- When creating your service account key, you receive a one-time download of the private key information. Make sure to download this file in either the PKCS12 or JSON format for use later in this tutorial. [source]
- For [featureCompatibilityVersion](https://www.mongodb.com/docs/manual/reference/command/setfeaturecompatibilityversion.md#std-label-view-fcv) `"4.0"`, [`createIndexes`](https://www.mongodb.com/docs/manual/reference/command/createindexes.md#mongodb-dbcommand-dbcmd.createIndexes) uses the pre-4.2 index build process which by default obtains an exclusive lock on the parent database for the entire duration of the build process. The pre-4.2 build process blocks all operations on the database *and* all its collections until the operation completed. `background` indexes do not take an exclusive lock. [source]
- - [atlas api alerts getAlertConfigAlerts](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-alerts-getalertconfigalerts.md#std-label-atlas-api-alerts-getAlertConfigAlerts) - Returns all open alerts that the specified alert configuration triggers. [source]
- The S and X locks at the end of the index build are held only while the mongod drains the remaining side writes and finalizes the index, so they are typically brief. The duration depends on the number of writes remaining in the side writes table when each stage begins. [source]
- Repeated runs on the same data will produce different outcomes since the selection process is non-deterministic. In general, smaller datasets will show more variability in the number of documents selected on each run. As collection size increases, the number of documents chosen will approach the expected value for a uniform random distribution. [source]
- A document that reports on the number of assertions raised since the MongoDB process started. Assertions are internal checks for errors that occur while the database is operating and can help diagnose issues with the MongoDB server. Non-zero asserts values indicate assertion errors, which are uncommon and not an immediate cause for concern. Errors that generate asserts can be recorded in the log file or returned directly to a client application for more information. [source]
- The number of regular assertions raised since the MongoDB process started. Examine the MongoDB log for more information. [source]
- The number of message assertions raised since the MongoDB process started. Examine the log file for more information about these messages. [source]
- The number of "user asserts" that have occurred since the last time the MongoDB process started. These are errors that user may generate, such as out of disk space or duplicate key. You can prevent these assertions by fixing a problem with your application or deployment. Server logs may have limited information about "user asserts." To learn more information about the source of "user asserts," check the application logs for application errors. [source]
- When run on a primary, the number of times flow control has engaged since the last restart. Flow control engages when the majority committed lag is greater than some percentage of the [`flowControlTargetLagSeconds`.](https://www.mongodb.com/docs/manual/reference/parameters.md#mongodb-parameter-param.flowControlTargetLagSeconds) [source]
- When run on the primary, the amount of time flow control has spent being engaged since the last restart. Flow control engages when the majority committed lag is greater than some percentage of the [`flowControlTargetLagSeconds`.](https://www.mongodb.com/docs/manual/reference/parameters.md#mongodb-parameter-param.flowControlTargetLagSeconds) [source]
- Reports aggregate metrics for FTDC (Full-Time Diagnostic Data Capture) collection runs since the MongoDB process started. Use these metrics to detect whether FTDC collections are falling behind the configured sampling period. [source]
- The total number of FTDC collection runs since the MongoDB process started. [source]
- The cumulative time, in microseconds, spent collecting FTDC samples since the MongoDB process started. [source]
- A document that reports the lifespans of the change stream cursors that have closed in this process. A cursor lifespan is the duration between the time the cursor opens and the time the cursor closes. [source]
- The cumulative number of change stream cursors opened in this process, including cursors that have since closed. The value increases when a cursor opens, including when a change stream resumes, and doesn't decrease when a cursor closes. [source]
- The total number of cursors that have returned more than one batch since the server process started. Additional batches are retrieved using the [`getMore`](https://www.mongodb.com/docs/manual/reference/command/getmore.md#mongodb-dbcommand-dbcmd.getMore) command. [source]
- The total number of times that threads hit stale config exception. Since a stale config exception triggers a refresh of the metadata, this number is roughly proportional to the number of metadata refreshes. [source]
- Number of collection metadata commits made to the shard's local catalog since the server started, such as when the cluster shards a collection or during resharding operations. [source]
- Number of post-recovery waits that completed when the cluster's config time advanced since the server started. [source]
- Number of post-recovery waits that completed when the collection's placement version changed since the server started. [source]
- Number of database metadata commits made to the shard's local catalog since the server started, such as when the cluster creates a database or during [`movePrimary`](https://www.mongodb.com/docs/manual/reference/command/moveprimary.md#mongodb-dbcommand-dbcmd.movePrimary) operations. [source]
- The total number of transactions in prepared state on this server since the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) process's last startup. [source]
- The total number of transactions that were prepared and committed on this server since the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) process's last startup. [source]
- The total number of transactions that were prepared and aborted on this server since the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) process's last startup. [source]
- You can use a search index configuration file to specify the settings required when you create an Atlas Search index or update an Atlas Search index using the Atlas CLI. The Atlas CLI accepts `.json` search index configuration files. [source]
- Turn the toggle on to subscribe or off to unsubscribe. When subscribing for the first time, select the cluster or clusters that you want the report to cover. The change applies to all Project Owner users in the project. [source]
- Removes [index filters](https://www.mongodb.com/docs/manual/core/query-plans.md#std-label-index-filters) on a collection. Although index filters only exist for the duration of the server process and do not persist after shutdown, you can also clear existing index filters with the [`planCacheClearFilters`](https://www.mongodb.com/docs/manual/reference/command/plancacheclearfilters.md#mongodb-dbcommand-dbcmd.planCacheClearFilters) command. [source]
- Two similar comparisons are made in the [`$match`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/match.md#mongodb-pipeline-pipe.-match) stage. First the [`$year`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/year.md#mongodb-expression-exp.-year) and [`$month`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/month.md#mongodb-expression-exp.-month) operators extract the year and month, respectively, from the `logoutTime` Date object. Then the month and year are checked to see if they match the selection targets. Since "January" is enc [source]
- | Name | Type | Required | Description | | --- | --- | --- | --- | | --endDate | int | false | Timestamp that specifies the end point for the range of log messages to download. MongoDB Cloud expresses this timestamp in the number of seconds that have elapsed since the UNIX epoch. | | --groupId | string | true | Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your p [source]
- - Atlas displays top namespaces by default. Depending on the time range, a namespace might fall in and out of the monitored list. Atlas interpolates missing data when at least one host metric exists in both ends of the time range. If Atlas encounters missing data, dotted lines connect the available data points. [source]
- - [atlas api monitoringAndLogs getIndexMeasurements](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-monitoringandlogs-getindexmeasurements.md#std-label-atlas-api-monitoringAndLogs-getIndexMeasurements) - Returns the Atlas Search metrics data series within the provided time range for one namespace and index name on the specified process. [source]
- - [atlas api monitoringAndLogs getProcessMeasurements](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-monitoringandlogs-getprocessmeasurements.md#std-label-atlas-api-monitoringAndLogs-getProcessMeasurements) - Returns disk, partition, or host measurements per process for the specified host for the specified project. [source]
- - [atlas api monitoringAndLogs listHostFtsMetrics](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-monitoringandlogs-listhostftsmetrics.md#std-label-atlas-api-monitoringAndLogs-listHostFtsMetrics) - Returns all Atlas Search metric types available for one process in the specified project. [source]
- - [atlas api monitoringAndLogs listIndexMeasurements](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-monitoringandlogs-listindexmeasurements.md#std-label-atlas-api-monitoringAndLogs-listIndexMeasurements) - Returns the Atlas Search index metrics within the specified time range for one namespace in the specified process. [source]
- - [atlas api monitoringAndLogs listMeasurements](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-monitoringandlogs-listmeasurements.md#std-label-atlas-api-monitoringAndLogs-listMeasurements) - Returns the Atlas Search hardware and status data series within the provided time range for one process in the specified project. [source]
- You can use a rolling index configuration file to specify the settings required when you create one rolling index using the Atlas CLI. The Atlas CLI accepts `.json` rolling index configuration files. [source]
- On Linux, use the `iostat` command to check if disk I/O is a bottleneck for your database. Specify a number of seconds when running iostat to avoid displaying stats covering the time since server boot. [source]
- When set to level `2`, the profiler ignores user provided values for `slowms` and `filter`. [source]
- The Query Profiler samples operations by using a bucketing algorithm that adjusts the sample size based on the width of the selected time range. Because of differences in bucket size, a wider time range might display fewer sampled operations than a narrower time range. For exact, unsampled operation counts, download your `mongod` logs. To learn more, see [View and Download MongoDB Logs.](https://www.mongodb.com/docs/atlas/mongodb-logs.md#std-label-mongodb-logs) [source]
How-to and procedures
- To learn more about the command syntax and parameters, see the Atlas CLI documentation for [atlas performanceAdvisor slowOperationThreshold disable.](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-performanceAdvisor-slowOperationThreshold-disable/) [source]
- To learn more about the command syntax and parameters, see the Atlas CLI documentation for [atlas performanceAdvisor slowOperationThreshold enable.](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-performanceAdvisor-slowOperationThreshold-enable/) [source]
- To learn more about the command syntax and parameters, see the Atlas CLI documentation for [atlas performanceAdvisor slowQueryLogs list.](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-performanceAdvisor-slowQueryLogs-list/) [source]
- To enable or disable Performance Advisor and the Query Profiler for a project, you must have the [`Project Owner`](https://www.mongodb.com/docs/atlas/reference/user-roles.md#mongodb-authrole-Project-Owner) role for the project or the [`Organization Owner`](https://www.mongodb.com/docs/atlas/reference/user-roles.md#mongodb-authrole-Organization-Owner) role on its parent organization. [source]
- To enable or disable Performance Advisor and the Query Profiler for a project, you must have the Project Owner role for the project or the Organization Owner role on its parent organization. [source]
- To learn more about the command syntax and parameters, see the Atlas CLI documentation for [atlas performanceAdvisor namespaces list.](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-performanceAdvisor-namespaces-list/) [source]
- To learn more about the command syntax and parameters, see the Atlas CLI documentation for [atlas performanceAdvisor suggestedIndexes list.](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-performanceAdvisor-suggestedIndexes-list/) [source]
- To view query performance in the Query Profiler, you must have [`Project Read Only`](https://www.mongodb.com/docs/atlas/reference/user-roles.md#mongodb-authrole-Project-Read-Only) or [`Project Observability Viewer`](https://www.mongodb.com/docs/atlas/reference/user-roles.md#mongodb-authrole-Project-Observability-Viewer) access to the project. [source]
- To view query performance in the Query Profiler, you must have Project Read Only or Project Observability Viewer access to the project. [source]
- Use collation to specify language-specific rules for string comparison, such as rules for lettercase and accent marks. The [collation document](https://www.mongodb.com/docs/manual/reference/collation/#collation-document) contains a `locale` field which indicates the [ICU Locale code](https://unicode-org.github.io/icu/userguide/locale/), and may contain other fields to define collation behavior. [source]
- To review the list of locales that MongoDB collation supports, see the [list of languages and locales](https://www.mongodb.com/docs/manual/reference/collation-locales-defaults.md#std-label-collation-languages-locales). To learn more about collation options, including which are enabled by default for each locale, see [Collation](https://www.mongodb.com/docs/manual/reference/collation.md#std-label-collation-document-fields) in the MongoDB manual. [source]
- Create cluster configurations that optimize read and write performance to reduce latency in your Atlas deployment. [source]
- To learn how to use the MongoDB MCP Server to get Performance Advisor recommendations, see [Access Performance Advisor with the MongoDB MCP Server.](https://www.mongodb.com/docs/atlas/performance-advisor/access-with-mcp.md#std-label-performance-advisor-mcp) [source]
- To learn how to create indexes that the Performance Advisor suggests, see [Create Suggested Indexes.](https://www.mongodb.com/docs/atlas/performance-advisor.md#std-label-pa-create-suggested-indexes) [source]
- To establish recommended indexes, the Performance Advisor uses these metrics in a formula to calculate the Impact, or performance improvement that creating an index matching that query shape would cause. When the Performance Advisor suggests indexes, it ranks the indexes by their Impact. The Impact is determined by the total wasted bytes read. [source]
- To drop or hide an index by using the MongoDB Shell, paste and run the command provided by the Performance Advisor. [source]
- To view field values in a sample query in the Performance Advisor, you must have Project Observability Viewer, Project Data Access Read Only, Project Data Access Read/Write, or Project Data Access Admin access to the project. [source]
- To learn how to create indexes that the Performance Advisor suggests, see Create Suggested Indexes. [source]
- To learn more about the performance advisor MCP tool, see [Performance Advisor Tool.](https://www.mongodb.com/docs/mcp-server/tools.md#std-label-mcp-pa-tool) [source]
- To use this command, you must authenticate with a user account, a service account, or an API key with the Project Read Only role. [source]
- To learn how to create and manage indexes using the MongoDB Atlas UI or the Atlas CLI, see [Create, View, Drop, and Hide Indexes.](https://www.mongodb.com/docs/atlas/atlas-ui/indexes/) [source]
- Create a new programmatic IAM (Identity and Access Management) user in the AWS management console by following the official AWS documentation on [Adding a User](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html). You will use this IAM (Identity and Access Management) user as a service account for your Queryable Encryption-enabled application. Your application authenticates with AWS KMS using the IAM (Identity and Access Management) user to encrypt and decrypt your Data Encryption Keys (DEKs) with your Customer Master Key (CMK). [source]
- Create a service account for your project [source]
- To create a service account on Google Cloud, follow the [Creating a service account](https://cloud.google.com/iam/docs/creating-managing-service-accounts#creating) guide in Google's official documentation. [source]
- To add a service account key on Google Cloud, follow the [Managing service account keys](https://cloud.google.com/iam/docs/creating-managing-service-account-keys) guide in Google's official documentation. [source]
- Run the following code to set the environment variables for this tutorial. Provide your Voyage API key, OpenAI API Key, and MongoDB cluster's SRV (DNS Service Record) [connection string.](https://www.mongodb.com/docs/manual/reference/connection-string/#find-your-mongodb-atlas-connection-string) [source]
- To enable or disable Real-Time Performance Panel for a project, you must have the [`Project Owner`](https://www.mongodb.com/docs/atlas/reference/user-roles.md#mongodb-authrole-Project-Owner) role for the project. [source]
- To learn more about the command syntax and parameters, see the Atlas CLI documentation for [atlas dataFederation logs.](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-dataFederation-logs/) [source]
- To calculate the duration of the catch-up phase, subtract [`totalCriticalSectionCommitTimeMillis`](https://www.mongodb.com/docs/manual/reference/command/serverstatus.md#mongodb-serverstatus-serverstatus.shardingStatistics.totalCriticalSectionCommitTimeMillis) from [`totalCriticalSectionTimeMillis`:](https://www.mongodb.com/docs/manual/reference/command/serverstatus.md#mongodb-serverstatus-serverstatus.shardingStatistics.totalCriticalSectionTimeMillis) [source]
- To view metrics with Query Shape Insights, you must have Project Observability Viewer, Project Data Access Read Only, Project Data Access Read/Write, Project Data Access Admin, or Project Owner access to the project. [source]
- To learn more about the command syntax and parameters, see the Atlas CLI documentation for [atlas dataFederation queryLimits create.](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-dataFederation-queryLimits-create/) [source]
- To learn more about the syntax and parameters for the previous commands, see the Atlas CLI documentation for [atlas dataFederation queryLimits list](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-dataFederation-queryLimits-list/) and [atlas dataFederation queryLimits describe.](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-dataFederation-queryLimits-describe/) [source]
- To learn more about the command syntax and parameters, see the Atlas CLI documentation for [atlas dataFederation queryLimits delete.](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-dataFederation-queryLimits-delete/) [source]
- To manage project alerts, you must have [`Project Owner`](https://www.mongodb.com/docs/atlas/reference/user-roles.md#mongodb-authrole-Project-Owner) or [`Project Alerts Manager`](https://www.mongodb.com/docs/atlas/reference/user-roles.md#mongodb-authrole-Project-Alerts-Manager) access to the project. Users with [`Organization Owner`](https://www.mongodb.com/docs/atlas/reference/user-roles.md#mongodb-authrole-Organization-Owner) access must add themselves to the project as a `Project Owner`. [source]
- To use certain notification methods, you must first set up notification methods in the project's settings. If the notification method's value becomes invalid, Atlas sends an email to the project owner. The following notification methods require set up in the project's settings: [source]
- To learn more about the syntax and parameters for the previous commands, see the Atlas CLI documentation for [atlas alerts settings create](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-alerts-settings-create/) and [atlas alerts settings-update.](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-alerts-settings-update/) [source]
- To learn more about the command syntax and parameters, see the Atlas CLI documentation for [atlas alerts settings fields type.](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-alerts-settings-fields-type/) [source]
- To learn more about the syntax and parameters for the previous commands, see the Atlas CLI documentation for [atlas alerts settings list](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-alerts-settings-list/) and [atlas alerts settings describe.](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-alerts-settings-describe/) [source]
- To learn more about the command syntax and parameters, see the Atlas CLI documentation for [atlas alerts settings disable.](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-alerts-settings-disable/) [source]
- To learn more about the command syntax and parameters, see the Atlas CLI documentation for [atlas alerts settings enable.](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-alerts-settings-enable/) [source]
- To learn more about the command syntax and parameters, see the Atlas CLI documentation for [atlas alerts settings delete.](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-alerts-settings-delete/) [source]
- Avoid specifying **only** the `timeField` as the shard key. Since the `timeField` [increases monotonically](https://www.mongodb.com/docs/manual/core/sharding-choose-a-shard-key.md#std-label-shard-key-monotonic), it may result in all writes appearing on a single chunk within the cluster. Ideally, data is evenly distributed across chunks. [source]
- To learn more about the query limits, see [https://dochub.mongodb.org/core/adf-query-limits.To](https://dochub.mongodb.org/core/adf-query-limits.To) use this command, you must authenticate with a user account, a service account, or an API key with the Project Owner role. [source]
- To expire data after a specified number of seconds has passed since the indexed field, create a TTL index on a field that holds values of BSON date type or an array of BSON date-typed objects *and* specify a value greater than or equal to zero in the `expireAfterSeconds` field. A document expires when the number of seconds in the `expireAfterSeconds` field has passed since the time specified in its indexed field.  [source]
Examples and snippets
- ```sh — `atlas performanceAdvisor slowOperationThreshold disable [options]` … [source]
- ```sh — `atlas performanceAdvisor slowOperationThreshold enable [options]` … [source]
- ```sh — `atlas performanceAdvisor slowQueryLogs list [options]` … [source]
- ```text — `atlas api performanceAdvisor listSchemaAdvice [options]` … [source]
- ```shell — `atlas api performanceAdvisor listSchemaAdvice --version 2024-08-05 --clusterName [clusterName] --groupId 32b6e` … [source]
- ```sh — `atlas performanceAdvisor namespaces list [options]` … [source]
- ```text — `atlas api performanceAdvisor listClusterSuggestedIndexes [options]` … [source]
- ```shell — `atlas api performanceAdvisor listClusterSuggestedIndexes --version 2024-08-05 --clusterName [clusterName] --gr` … [source]
- ```text — `atlas api performanceAdvisor listSlowQueryLogs [options]` … [source]
- ```shell — `atlas api performanceAdvisor listSlowQueryLogs --version 2023-01-01 --groupId <object-id> --proce` … [source]
- ```shell — `atlas api performanceAdvisor listSuggestedIndexes --version 2023-01-01 --groupId <object-id> --pr` … [source]
- ```text — `atlas api performanceAdvisor enableManagedSlowMs [options]` … [source]
- ```shell — `atlas api performanceAdvisor enableManagedSlowMs --version 2023-01-01 --groupId <object-id>` … [source]
- ```text — `atlas performanceAdvisor namespaces list [options]` … [source]
- ```text — `# Return a JSON-formatted list of namespaces for collections with slow queries for the atlas-111ggi-shard-00-0` … [source]
- ```text — `atlas performanceAdvisor slowOperationThreshold enable --projectId <object-id>` … [source]
- ```javascript — `db.cakeFlavors.aggregate( [ {` … [source]
- ```text — `Atlas management of the slow operation enabled` … [source]
- ```sh — `atlas performanceAdvisor suggestedIndexes list [options]` … [source]
- ```text — `atlas performanceAdvisor suggestedIndexes list [options]` … [source]
- ```text — `# Return a JSON-formatted list of suggested indexes for the atlas-111ggi-shard-00-00.111xx.mongodb.net:27017 h` … [source]
- ```text — `# Return a JSON-formatted list of log lines for collections with slow queries for the atlas-111ggi-shard-00-00` … [source]
- ```text — `atlas api alerts listAlerts [options]` … [source]
- ```shell — `atlas api alerts listAlerts --version 2023-01-01 --groupId <object-id>` … [source]
- ```text — `atlas api atlasSearch updateIndexByName [options]` … [source]
- ```text — `atlas api queryShapeInsights getClusterQueryShape [options]` … [source]
- ```shell — `atlas api queryShapeInsights getClusterQueryShape --version 2025-03-12 --clusterName [clusterName] --groupId 3` … [source]
- ```text — `atlas api monitoringAndLogs downloadClusterLog [options]` … [source]
- ```shell — `atlas api monitoringAndLogs downloadClusterLog --version 2023-02-01 --endDate 1609545600 --groupId [your-proje` … [source]
- ```text — `atlas api rollingIndex createRollingIndex [options]` … [source]
- ```shell — `atlas api rollingIndex createRollingIndex --version 2023-01-01 --clusterName [clusterName] --groupId 32b6e34b3` … [source]
- ```text — `atlas api monitoringAndLogs getIndexMeasurements [options]` … [source]
- ```shell — `atlas api monitoringAndLogs getIndexMeasurements --version 2023-01-01 --collectionName mycoll --databaseName m` … [source]
- ```shell — `atlas api monitoringAndLogs listMeasurements --version 2023-01-01 --granularity PT1M --groupId 32b6e34b3d91647` … [source]
- ```text — `atlas api monitoringAndLogs listDatabases [options]` … [source]
- ```shell — `atlas api monitoringAndLogs listDatabases --version 2023-01-01 --groupId <object-id> --processId ` … [source]
- ```text — `atlas api atlasSearch getClusterSearchIndex [options]` … [source]
- ```shell — `atlas api atlasSearch getClusterSearchIndex --version 2024-05-30 --clusterName [clusterName] --groupId 32b6e34` … [source]
- ```text — `atlas api monitoringAndLogs listGroupProcesses [options]` … [source]
- ```shell — `atlas api monitoringAndLogs listGroupProcesses --version 2023-01-01 --groupId [your-project-id]` … [source]
- ```text — `atlas api monitoringAndLogs getProcessDiskMeasurements [options]` … [source]
- ```shell — `atlas api monitoringAndLogs getProcessDiskMeasurements --version 2023-01-01 --granularity PT1M --groupId 32b6e` … [source]
- ```text — `atlas api atlasSearch deleteIndexByName [options]` … [source]
- ```shell — `atlas api atlasSearch deleteIndexByName --version 2024-05-30 --clusterName [clusterName] --collectionName [col` … [source]
- ```text — `atlas api alerts acknowledgeAlert [options]` … [source]
- ```javascript — `name: 'type_1_item_1',` … [source]
- ```text — `atlas api queryShapeInsights listQueryShapeSummaries [options]` … [source]
- ```javascript — `uri : 'statistics:',` … [source]
- ```bash — `var session = db.getMongo().startSession()` … [source]
- ```text — `atlas api monitoringAndLogs listHostFtsMetrics [options]` … [source]
- ```swift — `try client2.withSession(options: ClientSessionOptions(causalConsistency: true)) { s2 in` … [source]
- ```swift — `let options = ClientSessionOptions(causalConsistency: true)` … [source]
- ```shell — `atlas api monitoringAndLogs getGroupProcess --version 2023-01-01 --groupId <object-id> --processI` … [source]
- ```text — `atlas api onlineArchive downloadQueryLogs [options]` … [source]
- ```shell — `atlas api onlineArchive downloadQueryLogs --version 2023-01-01 --clusterName [clusterName] --endDate 1.6364813` … [source]
- ```text — `atlas api dataFederation downloadFederationQueryLogs [options]` … [source]
- ```shell — `atlas api dataFederation downloadFederationQueryLogs --version 2023-01-01 --endDate 1.636481348e+09 --groupId ` … [source]
- ```text — `atlas api alerts getAlertConfigAlerts [options]` … [source]
- ```shell — `atlas api alerts getAlertConfigAlerts --version 2023-01-01 --alertConfigId <object-id> --groupId ` … [source]
- ```text — `atlas api monitoringAndLogs listProcessDisks [options]` … [source]
- ```text — `atlas api atlasSearch listSearchIndex [options]` … [source]
- ```text — `atlas api atlasSearch deleteClusterSearchIndex [options]` … [source]
- ```text — `atlas api atlasSearch getIndexByName [options]` … [source]
- ```text — `atlas api atlasSearch updateClusterSearchIndex [options]` … [source]
- ```text — `atlas api monitoringAndLogs getDatabaseMeasurements [options]` … [source]
- ```shell — `atlas api monitoringAndLogs getDatabaseMeasurements --version 2023-01-01 --databaseName [databaseName] --granu` … [source]
- ```javascript — `db.runCommand(` … [source]
- ```javascript — `"was" : 2,` … [source]
- ```javascript — `db.setProfilingLevel(1, { slowms: 20, sampleRate: 0.42 })` … [source]
- ```javascript — `db.setProfilingLevel(0, { slowms: 20, sampleRate: 0.42 })` … [source]
- ```javascript — `"t": {` … [source]
Measurements and reference values
- - **Availability:** Atlas has a 99.995% uptime SLA. You can also configure multi-region and multi-cloud deployments with automated failover and continuous backups. [source]
- **Recommended threshold:** Set this alert well below your oplog window duration. For example, if your oplog window is 24 hours, consider alerting at 30–50% of that window (e.g., 8–12 hours) to give yourself time to respond before `mongot` falls off the oplog. [source]
Problems, failure modes and limitations
- atlas api performanceAdvisor listSlowQueryLogs` returns slow-query log lines identified by Performance Advisor and Query Profiler. Optional flags --includeMetrics, --includeOpType, --includeReplicaState add extracted fields; --nLogs caps line count. The pinned API version is 2023-01-01. [source]
- By default Atlas dynamically adjusts the slow-query threshold from the execution time of operations across the cluster. Opting out (disabling managedSlowMs) switches to a fixed 100 ms threshold; MongoDB recommends not setting the fixed threshold lower than 100 ms. [source]
- Permissions: viewing slow-query collections and suggested indexes needs Project Read Only or higher; enabling/disabling the Atlas-managed threshold needs Project Owner (Organization Owners must add themselves to the project first). Without Project Data Access Read Only or higher, sample-query field values are redacted. [source]
- Managed threshold limits: Free (M0) clusters have it disabled by default and cannot enable it; clusters with MongoDB Search enabled do not support it; Performance Advisor is available on M10+ and Flex clusters. [source]
- | Name | Type | Required | Description | | --- | --- | --- | --- | | --clusterName | string | true | Human-readable label that identifies the cluster. | | --envelope | envelope | false | Flag that indicates whether Application wraps the response in an envelope JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body. | | --groupId | string | true | Unique 24-hexadecimal digit str [source]
- - [atlas api performanceAdvisor disableManagedSlowMs](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-performanceadvisor-disablemanagedslowms.md#std-label-atlas-api-performanceAdvisor-disableManagedSlowMs) - Disables the slow operation threshold that MongoDB Cloud calculated for the specified project. [source]
- - [atlas api performanceAdvisor enableManagedSlowMs](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-performanceadvisor-enablemanagedslowms.md#std-label-atlas-api-performanceAdvisor-enableManagedSlowMs) - Enables MongoDB Cloud to use its slow operation threshold for the specified project. [source]
- - [atlas api performanceAdvisor listSlowQueryLogs](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-performanceadvisor-listslowquerylogs.md#std-label-atlas-api-performanceAdvisor-listSlowQueryLogs) - Returns log lines for slow queries that the Performance Advisor and Query Profiler identified. [source]
- | Name | Type | Required | Description | | --- | --- | --- | --- | | --duration | int | false | Length of time expressed during which the query finds slow queries among the managed namespaces in the cluster. This parameter expresses its value in milliseconds. If you don't specify the **since** parameter, the endpoint returns data covering the duration before the current time.; If you specify neither the **duration** nor **since** parameters, the endpoint returns data from the previous 24 hours. | | --envelope | envelope | false | Flag that indicates whether Application wraps the response in an [source]
- | Name | Type | Required | Description | | --- | --- | --- | --- | | --clusterName | string | true | Human-readable label that identifies the cluster. | | --commands | & | false | Retrieve query shape statistics matching specified MongoDB commands. To include multiple commands, pass the parameter multiple times delimited with an ampersand (&) between each command. The currently supported parameters are: find, distinct, aggregate, count, insert, update, and delete. The insert, update, and delete commands return results only for clusters running MongoDB 9.0 or later with write query shape statis [source]
- MongoDB 8.3 also introduces slow in-progress query log entries. Queries trigger a slow-in progress log during execution. These logs contain less information than standard slow query logs. MongoDB logs queries at most once if the query's duration surpasses the operationProfiling.slowOpInProgressThresholdMs. [source]
- | **MongoDB Version** | **Changes** | | --- | --- | | 6.1 | Slow operation log messages include [cache refresh time fields.](https://www.mongodb.com/docs/manual/reference/log-messages.md#std-label-log-messages-cache-refresh-times) | | 6.2 | Slow operation log messages include a `queryFramework` field that indicates which query engine executed the query: `queryFramework: "classic"` indicates that the classic engine executed the query.; `queryFramework: "sbe"` indicates that the slot-based query execution engine executed the query. | | 6.3 | Slow operation log messages and [database profiler](ht [source]
- | Name | Type | Required | Description | | --- | --- | --- | --- | | --duration | int | false | Length of time in milliseconds for which you want to return results. If you specify the since option, the duration starts at the date and time specified. If you don't set the since option, this command returns data from the duration before the current time. | | -h, --help | | false | help for list | | --nLog | int | false | Maximum number of log lines to return. This value defaults to 20000. | | --namespaces | strings | false | Namespaces from which to retrieve suggested slow query logs formatted a [source]
- To return up to 20 namespaces in `<database>.<collection>` format for collections experiencing slow queries using the Atlas CLI, run the following command: [source]
- To see an example log message for a query that used the slot-based execution engine, see [Slow Operation.](https://www.mongodb.com/docs/manual/reference/log-messages.md#std-label-log-message-json-examples-slow-op) [source]
- For deployments hosted in MongoDB Atlas, you can create and manage indexes with the MongoDB Atlas UI or the Atlas CLI. MongoDB Atlas also includes a Performance Advisor that recommends indexes to improve slow queries, ranks suggested indexes by impact, and recommends which indexes to drop. [source]
- To view collections with slow queries and see suggested indexes, you must have [`Project Read Only`](https://www.mongodb.com/docs/atlas/reference/user-roles.md#mongodb-authrole-Project-Read-Only) access or higher to the project. [source]
- - [atlas api performanceAdvisor getManagedSlowMs](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-performanceadvisor-getmanagedslowms.md#std-label-atlas-api-performanceAdvisor-getManagedSlowMs) - Get whether the Managed Slow MS feature is enabled. [source]
- - [atlas api performanceAdvisor listPerformanceAdvisorNamespaces](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-performanceadvisor-listperformanceadvisornamespaces.md#std-label-atlas-api-performanceAdvisor-listPerformanceAdvisorNamespaces) - Returns up to 20 namespaces for collections experiencing slow queries on the specified host. [source]
- You can use the Atlas UI, Atlas CLI, and the Atlas Administration API to view slow queries and suggestions for improving the performance of your queries from the Performance Advisor. [source]
- You can return log lines for slow queries that the Performance Advisor identifies from the Atlas Administration API with [Return Slow Queries](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-listslowqueries). To return suggested indexes and more with the Atlas Administration API, see [Performance Advisor.](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/group/endpoint-performance-advisor) [source]
- To view collections with slow queries and see suggested indexes, you must have Project Read Only access or higher to the project. [source]
- Client operations (such as queries) appear in the log if their duration exceeds the [slow operation threshold](https://www.mongodb.com/docs/manual/reference/command/profile.md#std-label-slowms-threshold-option) or when the [log verbosity level](https://www.mongodb.com/docs/manual/reference/log-messages.md#std-label-log-message-verbosity-levels) is at least 1. These log entries include the full command object associated with the operation. [source]
- Some high-latency [`$lookup`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/lookup.md#mongodb-pipeline-pipe.-lookup) operations may not generate a slow query log for the foreign collection. This can occur because slow query logs correspond with operations that are reported in the [database profiler](https://www.mongodb.com/docs/manual/reference/database-profiler.md#std-label-profiler), whereas latency metrics increment only when a [collection lock](https://www.mongodb.com/docs/manual/faq/concurrency.md#std-label-faq-concurrency-locking) is acquired. [source]
- Returns suggested indexes and slow query data for a database deployment. [source]
- The slow operation threshold determines which operations are flagged by the Performance Advisor and Query Profiler. When enabled, the application uses the average execution time for operations on your cluster to determine slow-running queries. As a result, the threshold is more pertinent to your cluster workload. Application-managed slow operation threshold is enabled by default for dedicated clusters (M10+). [source]
- Returns log lines for slow queries that the Performance Advisor and Query Profiler identified. [source]
- The [Performance Advisor](https://www.mongodb.com/docs/atlas/performance-advisor.md#std-label-pa-slow-queries) provides the easiest and quickest way to create an index. The Performance Advisor monitors queries that MongoDB considers slow and recommends indexes to improve performance. Atlas dynamically adjusts your slow query threshold based on the execution time of operations across your cluster. [source]
- It is possible to receive a Query Targeting alert for an inefficient query without receiving index suggestions from the Performance Advisor if the query exceeds the slow query threshold and the ratio of scanned to returned documents is greater than the threshold specified in the alert. [source]
- - [atlas performanceAdvisor slowOperationThreshold disable](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-performanceadvisor-slowoperationthreshold-disable.md#std-label-atlas-performanceAdvisor-slowOperationThreshold-disable) - Disable the application-managed slow operation threshold for your project. [source]
- - [atlas performanceAdvisor slowOperationThreshold enable](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-performanceadvisor-slowoperationthreshold-enable.md#std-label-atlas-performanceAdvisor-slowOperationThreshold-enable) - Enable the application-managed slow operation threshold for your project. [source]
- The slow operation threshold determines which operations are flagged by the Performance Advisor and Query Profiler. When disabled, the application considers any operation that takes longer than 100 milliseconds to be slow. [source]
- The threshold determines which operations the Performance Advisor and Query Profiler considers slow. When enabled, MongoDB Cloud uses the average execution time for operations on your cluster to determine slow-running queries. As a result, the threshold is more pertinent to your cluster workload. The slow operation threshold is enabled by default for dedicated clusters (M10+). When disabled, MongoDB Cloud considers any operation that takes longer than 100 milliseconds to be slow. [source]
- When an operation specifies a time limit for a query, slow query logs contain a deadline field. deadline indicates the time the operation must complete by, which is equal to the time at the start of the operation plus the value of the query timeout. [source]
- Starting in MongoDB 9.0, slow query logs include a `planRankerMethod` field that indicates which [query plan ranking mechanism](https://www.mongodb.com/docs/manual/core/query-plans.md#std-label-query-plan-options) selected the winning plan: [source]
- Some high-latency $lookup operations don't generate a slow query log for the foreign collection. This can occur because slow query logs correspond with operations that are reported in the Query Profiler, whereas latency metrics increment only when a collection lock is acquired. [source]
- To enable or disable the Atlas-managed slow operation threshold, you must have [`Project Owner`](https://www.mongodb.com/docs/atlas/reference/user-roles.md#mongodb-authrole-Project-Owner) access to the project. Users with [`Organization Owner`](https://www.mongodb.com/docs/atlas/reference/user-roles.md#mongodb-authrole-Organization-Owner) access must add themselves to the project as a `Project Owner`. [source]
- | Field | Type | Description | | --- | --- | --- | | `profile` | int | Configures the profiler level. The following profiler levels are available: `0`The profiler is off and does not collect any data. This is the default profiler level.`1`The profiler collects data for operations that exceed the `slowms` threshold or match a specified [filter.](https://www.mongodb.com/docs/manual/reference/method/db.setprofilinglevel.md#std-label-set-profiling-level-options-filter)When a filter is set:The `slowms` and `sampleRate` options are not used for profiling.; The profiler only captures operations that [source]
- | Log Message | Description | | --- | --- | | Accepted TLS connection from peer | Indicates that the server successfully parsed the peer certificate during the TLS handshake with an accepted ingress connection. | | Ingress TLS handshake complete | Indicates that the TLS handshake with an ingress connection is complete. | | Hello completed | Indicates that the initial connection handshake completed on an incoming client connection. MongoDB displays the log message only with the first `hello` command. | | Auth metrics report | Specifies the completion of a step in the authentication conversation [source]
- You can return log lines for slow queries that the Query Profiler identifies from the Atlas Administration API with [Return Slow Queries.](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-listslowqueries) [source]
- Client operations (such as queries) appear in the log if their duration exceeds the slow operation threshold or when the log verbosity level is at least 1. [2] These log entries include the full command object associated with the operation. [source]
- Atlas collects and displays statistics from any of your [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) instances. The Query Profiler stores your `mongod` query [log data](https://www.mongodb.com/docs/atlas/mongodb-logs.md#std-label-mongodb-logs), which can be accessed directly through the Query Profiler or through the Atlas CLI, and use it to identify slow queries. Atlas displays this data on the Query Insights page, in the Query Profiler tab of an instance. [source]
- To opt out of the Atlas-managed slow operation threshold and use a fixed slow query threshold of 100 milliseconds instead, use the Atlas Administration API. See [Disable Managed Slow Operation Threshold](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-disablegroupmanagedslowms). For Free clusters (formerly known as `M0`) and Flex clusters, Atlas disables the Atlas-managed slow query operation threshold by default and you can't enable it. [source]
- [Unique](https://www.mongodb.com/docs/manual/reference/method/db.collection.createIndex/#options-for-all-index-types) [index options](https://www.mongodb.com/docs/manual/reference/method/db.collection.createIndex/#options) are incompatible with building indexes in a rolling fashion. If you specify `unique` in the Options pane, Atlas rejects your configuration with an error message. [source]
- | Field | Type | Literal or Normalized | Description | | --- | --- | --- | --- | | `key` | Document | Literal | Contains the query shape and additional query attributes that group a set of queries together | | `key.queryShape` | Document | Literal | Contains attributes used to group similar queries together. For more information, see [Query Shape.](https://www.mongodb.com/docs/manual/reference/operator/aggregation/querystats.md#std-label-queryStats-queryShape) | | `key.client` | Document | Literal | Describes client information associated with the key | | `key.client.application` | Document | [source]
- | Notification Option | Description | | --- | --- | | Atlas Project | Sends the alert by email or text message to users with specific roles in the Project. Atlas Project is the default alert recipient. You can configure the roles the alert is sent to and how it's delivered. You can't add a second Atlas Project as the recipient. If the [`Project Owner`](https://www.mongodb.com/docs/atlas/reference/user-roles.md#mongodb-authrole-Project-Owner) role is assigned to a human project member, Atlas delivers alerts to that member's configured email address or SMS target. If the [`Project Owner`](https: [source]
- The namespace length limit for unsharded collections and views is 255 bytes, and 235 bytes for sharded collections. For a collection or a view, the namespace includes the database name, the dot (`.`) separator, and the collection/view name (e.g. `<database>.<collection>`). [source]
- Atlas can send you a Query Shape Report email that summarizes inefficient query shapes for a cluster in your project. To help you identify and investigate slow queries, the report links directly to the Query Shape Insights page. [source]
- The Performance Advisor provides holistic schema recommendations for your cluster by sampling documents in your most active collections and collections with slow-running queries. [source]
- To learn more about the MongoDB Atlas Performance Advisor, see [Monitor and Improve Slow Queries.](https://www.mongodb.com/docs/atlas/performance-advisor/) [source]
- The Performance Advisor monitors queries that MongoDB considers slow and suggests new indexes to improve query performance. The threshold for slow queries varies based on the average time of operations on your cluster to provide recommendations pertinent to your workload. [source]
- The Performance Advisor can't suggest indexes for MongoDB databases configured to use the `ctime` timestamp format. As a workaround, set the timestamp format for such databases to either `iso8601-utc` or `iso8601-local`. To learn more about timestamp formats, see [mongod --timeStampFormat.](https://www.mongodb.com/docs/manual/reference/program/mongod/#std-option-mongod.--timeStampFormat) [source]
- - You can't create indexes through the Performance Advisor if [Data Explorer](https://www.mongodb.com/docs/atlas/atlas-ui.md#std-label-atlas-ui) is disabled for your project. You can still view the Performance Advisor recommendations, but you must create those indexes from [`mongosh`.](https://www.mongodb.com/docs/mongodb-shell.md#mongodb-binary-bin.mongosh) [source]
- Return the suggested indexes for collections experiencing slow queries. [source]
- The Performance Advisor monitors queries that MongoDB considers slow and suggests new indexes to improve query performance. [source]
- | Method | Availability | Description | | --- | --- | --- | | Use the Atlas Performance Advisor | M10+ Atlas clusters | The Atlas Performance Advisor monitors slow queries and suggests new indexes to improve performance. For more information, see [Monitor and Improve Slow Queries with the Performance Advisor.](https://www.mongodb.com/docs/atlas/performance-advisor.md#std-label-performance-advisor) | | Check ongoing operations in Atlas | M10+ Atlas clusters | You can use the [Atlas Real-Time Performance Panel](https://www.mongodb.com/docs/atlas/real-time-performance-panel.md#std-label-real-time [source]
- - [Monitor and improve slow queries](https://www.mongodb.com/docs/atlas/performance-advisor.md#std-label-performance-advisor) with the Performance Advisor. [source]
- The Performance Advisor automatically analyzes logs for slow-running queries and recommends indexes to create and drop. It analyzes slow queries and provides index suggestions for individual collections, ranked by a calculated impact score, and tailored to your workload. This gives you an easy, instantaneous way to make high-impact performance improvements. We recommend that you monitor regularly, focus on slow queries, and enable the profiler selectively to minimize overhead. [source]
- / Analyze Slow Queries / Performance Advisor [source]
- Docs Home / Management / Monitor Clusters / Analyze Slow Queries / Performance Advisor [source]
- - [atlas performanceAdvisor slowQueryLogs](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-performanceadvisor-slowquerylogs.md#std-label-atlas-performanceAdvisor-slowQueryLogs) - Get log lines for slow queries for a specified host [source]
- - [atlas performanceAdvisor suggestedIndexes](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-performanceadvisor-suggestedindexes.md#std-label-atlas-performanceAdvisor-suggestedIndexes) - Get suggested indexes for collections experiencing slow queries [source]
- Monitor and Improve Slow Queries with the Performance Advisor [source]
- You can't create indexes through the Performance Advisor if Data Explorer is disabled for your project. You can still view the Performance Advisor recommendations, but you must create those indexes from mongosh. [source]
- You can use the MongoDB MCP server to get [Performance Advisor](https://www.mongodb.com/docs/atlas/performance-advisor.md#std-label-performance-advisor) recommendations from your preferred AI tools by using natural language. These recommendations include retrieving slow queries, performing index management, and suggesting schema improvements. [source]
- This limitation does not apply to the Performance Advisor UI in Atlas. [source]
- | Use Case | Example Prompts | Performance Advisor Operation | | --- | --- | --- | | Analyze Slow Queries | `Show me my slow queries``What is slowing down my cluster?``Show me queries that are longer than 5 seconds``Show me slow writes in the website.users namespace` | [slowQueryLogs](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-listgroupprocessperformanceadvisorslowquerylogs) | | Index Suggestions | `Are there any indexes I should create to improve performance?``What indexes do you recommend I drop?` | [suggestedIndexes](https://www.mongodb.com/docs/api/doc/atla [source]
- | Method | Availability | Description | | --- | --- | --- | | Use the Atlas Query Profiler | M10+ Atlas clusters | The Atlas Query Profiler shows long-running operations and performance statistics. For more information, see [Monitor Query Performance with the Query Profiler.](https://www.mongodb.com/docs/atlas/tutorial/query-profiler.md#std-label-profile-database) | | Enable the Database Profiler | Atlas clusters and self-hosted deployments | When enabled, the database profiler stores information about slow queries in the [`system.profile`](https://www.mongodb.com/docs/manual/reference/system- [source]
- The [profiler entries](https://www.mongodb.com/docs/manual/tutorial/manage-the-database-profiler.md#std-label-database-profiler) and the [diagnostic log messages (i.e. mongod/mongos logmessages)](https://www.mongodb.com/docs/manual/reference/log-messages.md#std-label-log-message-slow-ops) for read/write operations include: [source]
- Starting in MongoDB 8.0, the existing `queryHash` field is duplicated in a new field named `planCacheShapeHash`. If you're using an earlier MongoDB version, you'll only see the `queryHash` field. Future MongoDB versions will remove the deprecated `queryHash` field, and you'll need to use the `planCacheShapeHash` field instead. [source]
- A single operation may log more than one entry. For example, if more than one write in a [bulk write operation](https://www.mongodb.com/docs/manual/core/bulk-write-operations.md#std-label-bulk-write-operations) exceeds the slow operation threshold, each slow write is logged separately. [source]
- For a [pretty-printed](https://www.mongodb.com/docs/manual/reference/log-messages.md#std-label-log-message-pretty-printing) example of a slow operation log entry, see [Log Message Examples.](https://www.mongodb.com/docs/manual/reference/log-messages.md#std-label-log-message-json-examples) [source]
- - Response Length: Unusually large response lengths indicate that queries are returning more data than necessary. Consider using [projections](https://www.mongodb.com/docs/manual/tutorial/project-fields-from-query-results.md#std-label-projections) to limit the fields returned. [source]
- | Name | Type | Required | Description | | --- | --- | --- | --- | | --clusterName | string | true | Name of the cluster that contains the collection whose Atlas Search index you want to update. | | --collectionName | string | true | Name of the collection that contains one or more Atlas Search indexes. | | --databaseName | string | true | Label that identifies the database that contains the collection with one or more Atlas Search indexes. | | --envelope | envelope | false | Flag that indicates whether Application wraps the response in an envelope JSON object. Some API clients cannot access t [source]
- | Name | Type | Required | Description | | --- | --- | --- | --- | | --endDate | int | false | Specifies the date and time for the ending point of the range of log messages to retrieve, in the number of seconds that have elapsed since the UNIX epoch. This value will default to 24 hours after the start date. If the start date is also unspecified, the value will default to the time of the request. | | --envelope | envelope | false | Flag that indicates whether Application wraps the response in an envelope JSON object. Some API clients cannot access the HTTP response headers or status code. To re [source]
- | Name | Type | Required | Description | | --- | --- | --- | --- | | --collectionName | string | true | Human-readable label that identifies the collection. | | --databaseName | string | true | Human-readable label that identifies the database. | | --end | string | false | Date and time when MongoDB Cloud stops reporting the metrics. This parameter expresses its value in the ISO 8601 timestamp format in UTC. Include this parameter when you do not set **period**. | | --envelope | envelope | false | Flag that indicates whether Application wraps the response in an envelope JSON object. Some API c [source]
- Limits the amount of memory that simultaneous [index builds](https://www.mongodb.com/docs/manual/core/index-creation.md#std-label-index-build-process) on one collection may consume for their duration. The specified amount of memory is shared between all indexes built using a single [`createIndexes`](https://www.mongodb.com/docs/manual/reference/command/createindexes.md#mongodb-dbcommand-dbcmd.createIndexes) command or its shell helper [`db.collection.createIndexes()`](https://www.mongodb.com/docs/manual/reference/method/db.collection.createindexes.md#mongodb-method-db.collection.createIndexes) [source]
- **Deprecated since version 6.2** [source]
- As each stage in a `$facet` executes, the resulting document is limited to 100 megabytes. Note the [allowDiskUse](https://www.mongodb.com/docs/manual/reference/command/aggregate.md#std-label-aggregate-cmd-allowDiskUse) flag doesn't affect the 100 megabyte size limit, since `$facet` can't spill to disk. [source]
- Since reading.timestamp is not included in an index, MongoDB must perform an in-memory sort operation to return results in the requested sort order. By specifying cursor.allowDiskUse(false), MongoDB cannot process the sort operation if it requires more than 100 megabytes of system memory. If the operation requires more than 100 megabytes of system memory, MongoDB would return an error. [source]
- | Output Field | Description | | --- | --- | | `name` | Index name. | | [key](https://www.mongodb.com/docs/manual/reference/operator/aggregation/indexstats.md#std-label-indexStats-output-key) | Index key specification. See also: [spec.](https://www.mongodb.com/docs/manual/reference/operator/aggregation/indexstats.md#std-label-indexStats-output-spec) | | [host](https://www.mongodb.com/docs/manual/reference/operator/aggregation/indexstats.md#std-label-indexStats-output-host) | The hostname and port of the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-b [source]
- [`$where`](https://www.mongodb.com/docs/manual/reference/operator/query/where.md#mongodb-query-op.-where) no longer supports the deprecated [BSON type](https://www.mongodb.com/docs/manual/reference/bson-types.md#std-label-bson-types) JavaScript code with scope (BSON Type 15). The [`$where`](https://www.mongodb.com/docs/manual/reference/operator/query/where.md#mongodb-query-op.-where) operator only supports BSON type String (BSON Type 2) or BSON type JavaScript (BSON Type 13). The use of BSON type JavaScript with scope for [`$where`](https://www.mongodb.com/docs/manual/reference/operator/query/ [source]
- Number of times since startup that a query operation failed because it exceeded memory-tracking limits. Use this metric to determine whether the memory limit is too low for your workload. [source]
- Largest amount of memory in bytes tracked for a single operation since startup. Use this metric to determine an appropriate per-operation memory limit for your workload. [source]
- **Deprecated since version 8.0** [source]
- **Deprecated since version 7.3**[`totalOperationsKilled`](https://www.mongodb.com/docs/manual/reference/command/serverstatus.md#mongodb-serverstatus-serverstatus.metrics.repl.stateTransition.totalOperationsKilled) replaces `userOperationsKilled`. [source]
- **Deprecated since version 7.3**[`totalOperationsRunning`](https://www.mongodb.com/docs/manual/reference/command/serverstatus.md#mongodb-serverstatus-serverstatus.metrics.repl.stateTransition.totalOperationsRunning) replaces `userOperationsRunning`. [source]
- The total number of cursors that have timed out since the server process started. If this number is large or growing at a regular rate, this may indicate an application error. [source]
- **Deprecated since version 9.0**The `databaseVersionUpdateCounters` server status is renamed to [`databaseShardingMetadataStatistics`.](https://www.mongodb.com/docs/manual/reference/command/serverstatus.md#mongodb-serverstatus-serverstatus.shardingStatistics.databaseShardingMetadataStatistics) [source]
- | Component | Character Limit | RegEx Pattern | | --- | --- | --- | | Cluster Name | 64 | `^([a-zA-Z0-9]([a-zA-Z0-9-]){0,21}(?<!-)([\w]{0,42}))$` | | Project Name | 64 | `^[\p{L}\p{N}\-_.(),:&@+']{1,64}$` | | Organization Name | 64 | `^[\p{L}\p{N}\-_.(),:&@+']{1,64}$` | | API Key Description | 250 | | [source]
- | Stage | Description | | --- | --- | | Lock | The `mongod` obtains an exclusive `X` lock on the the collection being indexed. This blocks all read and write operations on the collection, including the application of any replicated write operations or metadata commands that target the collection. The `mongod` does not yield this lock. | | Initialization | The `mongod` creates three data structures at this initial state: The initial index metadata entry.; A temporary table ("side writes table") that stores keys generated from writes to the collection being indexed during the build process.; A t [source]
- - Inserting a document with `Timestamp(0,0)` associated to an encrypted field. The `(0,0)` value indicates that the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) should generate the Timestamp. Since the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) cannot generate encrypted fields, the resulting timestamp would be unencrypted. [source]
- | Input Type | Behavior | | --- | --- | | Boolean | Returns Long(0) for `false`.Returns Long(1) for `true`. | | Double | Returns truncated value. The truncated double value must fall within the minimum and maximum value for a long. You cannot convert a double value whose truncated value is less than the minimum long value or is greater than the maximum long value. | | Decimal | Returns truncated value. The truncated decimal value must fall within the minimum and maximum value for a long. You cannot convert a decimal value whose truncated value is less than the minimum long value or is greater [source]
- You can delete a project or per federated database instance limit from the Atlas CLI, Atlas UI, and API (Application Programming Interface). [source]
- | Option | Description | More Information | | --- | --- | --- | | Create unique index | Ensure that the indexed fields do not store duplicate values. You cannot perform a rolling build for a unique index. If you enable building indexes in a rolling fashion with the `unique` index option, Atlas rejects your configuration with an error message. | [Unique Indexes](https://www.mongodb.com/docs/manual/core/index-unique/) | | Index name | Specify a name for the index. | [Specify an Index Name](https://www.mongodb.com/docs/manual/core/indexes/create-index/specify-index-name.md#std-label-specify-index [source]
- | Input Type | Behavior | | --- | --- | | Boolean | Returns `Decimal128("0")` for `false`.Returns `Decimal128("1")` for `true`. | | Double | Returns double value as a decimal. | | Decimal | No-op. Returns the decimal. | | Integer | Returns the int value as a decimal. | | Long | Returns the long value as a decimal. | | String | Returns the numerical value of the string as a decimal. The string value must be of a base 10 numeric value (e.g. `"-5.5"`, `"123456"`). You cannot convert a string value of a non-base 10 number (e.g. `"0x6400"`) | | Date | Returns the number of milliseconds since the e [source]
- | Input Type | Behavior | | --- | --- | | Boolean | Returns NumberDouble(0) for `false`.Returns NumberDouble(1) for `true`. | | BinData | Returns the `binData` value as a double. `binData` is interpreted as an IEEE 754 single-precision or double-precision floating point. The number of bytes in the `binData` value must be `4` or `8`. If the `input` is of an unexpected length an error is generated. You can control this behavior by configuring `$convert.onError`. | | Double | No-op. Returns the double. | | Decimal | Returns the decimal value as a double. The decimal value must fall within the mi [source]
- Returns up to 20 namespaces for collections experiencing slow queries on the specified host. [source]
- Retrieve namespaces for collections experiencing slow queries [source]
- - **After 1 hour:** Atlas sends a warning email to the project owners. [source]
- | Name | Type | Required | Description | | --- | --- | --- | --- | | --alertConfigId | string | true | Unique 24-hexadecimal digit string that identifies the alert configuration. | | --envelope | envelope | false | Flag that indicates whether Application wraps the response in an envelope JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body. | | --groupId | string | true | Uni [source]
- When running MongoDB servers and clients on NUMA hardware, you should configure a memory interleave policy so that the host behaves in a non-NUMA fashion. MongoDB checks NUMA settings on start up when deployed on Linux (since version 2.0) and Windows (since version 2.6) machines. If the NUMA configuration may degrade performance, MongoDB prints a warning. [source]
- **Deprecated since version 3.4**[`$substr`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/substr.md#mongodb-expression-exp.-substr) is now an alias for [`$substrBytes`.](https://www.mongodb.com/docs/manual/reference/operator/aggregation/substrbytes.md#mongodb-expression-exp.-substrBytes) [source]
- **Note: Deprecated since v3.2** [source]
- These operations are also included in the logging of slow queries. See slowOpThresholdMs for more information about slow query logging. [source]
- If the `$lookup` query on a shard can perform a local read, the `$lookup` doesn't record a separate operation for querying the foreign collection. A local read refers to when the query on the foreign collection targets only the same shard where the current operation is being executed. As a result, the `$lookup` operation increases the `$collStats` latency metrics and operation counts, but does not generate a slow query log for the foreign collection. [source]
- Atlas clusters with MongoDB Search enabled don't support the Atlas-managed slow query operation threshold. [source]
- For Free clusters (formerly known as `M0`), Atlas disables the Atlas-managed slow query operation threshold by default and you can't enable it. [source]
- For a [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) instance, the command enables, disables, or configures the [database profiler](https://www.mongodb.com/docs/manual/tutorial/manage-the-database-profiler.md#std-label-database-profiler). The profiler captures and records data on the performance of write operations, cursors, and database commands on a running [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) instance. If the profiler is disabled, the command configures how slow operations [source]
- With [`mongos`](https://www.mongodb.com/docs/manual/reference/program/mongos.md#mongodb-binary-bin.mongos) instances, the method sets the `slowms`, `sampleRate` and `filter` configuration settings, which configure how operations get written to the diagnostic log. You cannot enable the [Database Profiler](https://www.mongodb.com/docs/manual/tutorial/manage-the-database-profiler.md) on a [`mongos`](https://www.mongodb.com/docs/manual/reference/program/mongos.md#mongodb-binary-bin.mongos) instance because `mongos` does not have any collections that the profiler can write to. The `profile` level m [source]
- - the slow operation threshold [slowms](https://www.mongodb.com/docs/manual/reference/method/db.setprofilinglevel.md#std-label-set-profiling-level-options-slowms) to `20` milliseconds, and [source]
- In rare circumstances, a write can fail due to cache pressure. When this happens MongoDB issues a `TemporarilyUnavailable` error and increments the `temporarilyUnavailableErrors` counter in two places: the slow query log and the [Full Time Diagnostic Data Capture (FTDC).](https://www.mongodb.com/docs/manual/administration/full-time-diagnostic-data-capture.md#std-label-ftdc-stub) [source]
- Enable the application-managed slow operation threshold for your project. [source]
- To optimize your query performance, [review the best practices for query performance](https://www.mongodb.com/docs/atlas/analyze-slow-queries.md#std-label-query-best-practices). You can also [analyze slow queries](https://www.mongodb.com/docs/atlas/analyze-slow-queries.md#std-label-analyze-slow-queries) and troubleshoot slow operations executed on your clusters. [source]
- The Query Profiler identifies slow queries and bottlenecks, and suggests index refinement and query restructuring to improve the performance of your database. It provides visibility into the slowest operations over up to seven days in the Atlas UI, making it easier to identify trends and outliers in query efficiency. We recommend that you use this data to pinpoint and troubleshoot poorly performing queries, reducing performance overhead. [source]
- The [Query Profiler](https://www.mongodb.com/docs/atlas/tutorial/query-profiler.md#std-label-query-profiler) displays slow-running operations and their key performance statistics. You can explore a sample of historical queries for up to the last seven days without additional cost or performance overhead. Before you enable the Query Profiler, see [Considerations.](https://www.mongodb.com/docs/atlas/tutorial/query-profiler.md#std-label-atlas-considerations-profile-database) [source]
- Without the index, the query scans the entire collection to return the matching documents. The query also has to scan the entirety of each document, potentially pulling them into memory. This results in an expensive and potentially slow query operation. [source]
- Slow operations are logged based on `workingMillis`, which is the amount of time that MongoDB spends working on that operation. This means that factors such as waiting for locks and flow control do not affect whether an operation exceeds the slow operation threshold. [source]
- [`--slowOpSampleRate`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#std-option-mongod.--slowOpSampleRate) does not affect the slow oplog entry logging by the secondary members of a replica set. Secondary members log all oplog entries that take longer than the slow operation threshold regardless of the [`--slowOpSampleRate`.](https://www.mongodb.com/docs/manual/reference/program/mongod.md#std-option-mongod.--slowOpSampleRate) [source]
- Secondary members of a replica set now [log oplog entries](https://www.mongodb.com/docs/manual/core/replica-set-oplog.md#std-label-slow-oplog-application) that take longer than the slow operation threshold to apply. These slow oplog messages: [source]
- Click Create Index on a slow query for instructions on how to create the recommended index. [source]
- Enable or disable management of the slow operation threshold for your cluster. [source]
- Disable the application-managed slow operation threshold for your project. [source]
- These operations are also included in the logging of slow queries. See [`slowOpThresholdMs`](https://www.mongodb.com/docs/manual/reference/configuration-options.md#mongodb-setting-operationProfiling.slowOpThresholdMs) for more information about slow query logging. [source]
- Enables MongoDB Cloud to use its slow operation threshold for the specified project. [source]
- Disables the slow operation threshold that MongoDB Cloud calculated for the specified project. [source]
- | Profiler | Description | | --- | --- | | [Atlas Query Profiler](https://www.mongodb.com/docs/atlas/tutorial/query-profiler.md#std-label-query-profiler) | Provides a scatterplot chart to Atlas customers, making it easy to identify slow queries and performance outliers. | | [Database Profiler](https://www.mongodb.com/docs/manual/tutorial/manage-the-database-profiler.md#std-label-database-profiler) | Stores query performance information in a collection, allowing you to query MongoDB for queries with specific performance issues. | [source]
- [2](1, 2, 3, 4) Secondary members of a replica set now log oplog entries that take longer than the slow operation threshold to apply. These slow oplog messages: [source]
- A single operation may log more than one entry. For example, if more than one write in a bulk write operation exceeds the slow operation threshold, each slow write is logged separately. [source]
- The totalOplogSlotDurationMicros in the slow query log message shows the time between a write operation getting a commit timestamp to commit the storage engine writes and actually committing. mongod supports parallel writes. However, it commits write operations with commit timestamps in any order. [source]
- The slow query output includes a queues document that contains information about the operation's queues. Each queue in the queues field contains a totalTimeQueuedMicros field that contains the total cumulative time in microseconds that the operation spent in the corresponding queue. [source]
- The queryShapeHash field for a query shape is also included in the slow query log when available. [source]
- Slow query log messages contain new metrics if the query execution writes temporary files to disk. These metrics are prefixed by the query execution stage that caused the query to exceed the memory limit. For example, sortSpills indicates the number of times that the sort stage of query execution wrote temporary files to disk. [source]
- When a query shape has query knobs set through setQuerySettings or setParameter, slow query log entries include a queryKnobs document. The document shows the effective value of each knob and where the value comes from, with the same shape as the explain output. For details, see Query Knobs. [source]
- If you configure slow operations logging. [source]
- To determine if a merge operation or a shard issue is causing a slow query, compare the workingMillis and remoteOpWaitMillis time fields in the log. workingMillis is the total time the query took to complete. Specifically: [source]
- When using Queryable Encryption, CRUD operations against encrypted collections are omitted from the slow query log. For details, see Queryable Encryption redaction. [source]
- With slow operation logging enabled, the following returns only the slow operations that took above 2000 milliseconds:, for further analysis: [source]
- Disable the Atlas-Managed Slow Operation Threshold [source]
- To disable the Atlas-managed slow operation threshold and use a fixed threshold of 100 milliseconds: [source]
- Enable the Atlas-Managed Slow Operation Threshold [source]
- When using [Queryable Encryption](https://www.mongodb.com/docs/manual/core/queryable-encryption.md#std-label-qe-manual-feature-qe), CRUD operations against encrypted collections are omitted from the slow query log. For details, see [Queryable Encryption redaction.](https://www.mongodb.com/docs/manual/core/queryable-encryption/reference/limitations.md#std-label-qe-redaction) [source]
- With [slow operation logging](https://www.mongodb.com/docs/manual/reference/log-messages.md#std-label-log-message-slow-ops) enabled, the following returns only the slow operations that took above 2000 milliseconds:, for further analysis: [source]
- Assume a [slow query](https://www.mongodb.com/docs/manual/reference/log-messages.md#std-label-log-message-slow-ops) is run on `myView`. The following example log message contains a `resolvedViews` field for `myView`: [source]
- The CRUD operations below are omitted from the [slow operations](https://www.mongodb.com/docs/manual/reference/log-messages.md#std-label-log-message-slow-ops) query log and the [Database Profiler](https://www.mongodb.com/docs/manual/reference/database-profiler.md#std-label-profiler) `system.profile` collection when you run them on an encrypted collection. [source]
- You can stop slow operations from the Performance Tab. [source]
- The Query Profiler diagnoses and monitors performance issues. This monitoring can expose slow-running queries and their key performance statistics in the Atlas UI. [source]
- The Atlas Query Profiler shows operations across your entire cluster by default. You can filter the Query Profiler view to only operations coming from specified hosts with the Filter by Hosts dropdown, which allows you to view data related to one or more specific hosts or to view primary or secondary host groups. The Query Insights option in the Cluster sidebar displays information to reveal slow database operations over a set time frame, such as the following: [source]
- Atlas manages the threshold for slow operations for each `mongod` host based on average operation execution time on that host. This threshold can be changed using the [`db.setProfilingLevel`](https://www.mongodb.com/docs/manual/reference/method/db.setProfilingLevel.md#mongodb-method-db.setProfilingLevel) [`mongosh`](https://www.mongodb.com/docs/mongodb-shell.md#mongodb-binary-bin.mongosh) command. [source]
- Changing the threshold for slow operations using [`db.setProfilingLevel`](https://www.mongodb.com/docs/manual/reference/method/db.setProfilingLevel.md#mongodb-method-db.setProfilingLevel) can impact performance and system log settings. Carefully consider any performance and security implications before you use [`db.setProfilingLevel`](https://www.mongodb.com/docs/manual/reference/method/db.setProfilingLevel.md#mongodb-method-db.setProfilingLevel) to adjust the Query Profiler settings on a production deployment. Query Profiler settings reset to default values following a node restart. [source]
- Additionally, zooming in on the x axis of the scatterplot refetches slow operations and may provide more detailed fidelity of slow operations during the selected time frame. [source]
- The following section describes how to find slow queries using the Query Profiler. [source]
- The Query Profiler uses a scatterplot chart and a table directly below the chart to help you find slow operations. [source]
- - Operation Execution Time (`millis`): Query time in milliseconds. This is the primary indicator of a slow query. If this metric is consistently high, consider optimizing the query logic, batching results, or rethink how the data is being accessed. [source]
- When performing slow query analysis, the MCP Server retrieves a sample of slow queries, capped at 50 queries. The sample includes up to 50 most recent slow queries that match any specified conditions in your prompt to ensure optimal performance and response times. [source]
- Changing the threshold for slow operations using db.setProfilingLevel can impact performance and system log settings. Carefully consider any performance and security implications before you use db.setProfilingLevel to adjust the Query Profiler settings on a production deployment. Query Profiler settings reset to default values following a node restart. [source]
- Find Slow Queries with the Query Profiler [source]
Comparisons and alternatives
- Performance Advisor ranks suggested indexes by Impact, based on total wasted bytes read, and considers workload on all replica set nodes including secondaries. It cannot suggest indexes for databases using the ctime timestamp format (workaround: iso8601-utc or iso8601-local), and consecutive $match stages may coalesce so the reported query shape differs from the one run. [source]
- Index creation through the Performance Advisor UI is one index at a time, and is unavailable if Data Explorer is disabled for the project; for automation, create suggested indexes from mongosh, a driver, or the API instead of the Advisor UI. [source]
- | Field | Field Type | Necessity | Description | | --- | --- | --- | --- | | `setQuerySettings` | document or string | Required | You can provide either: The same fields as those in a [`find`](https://www.mongodb.com/docs/manual/reference/command/find.md#mongodb-dbcommand-dbcmd.find), [`distinct`](https://www.mongodb.com/docs/manual/reference/command/distinct.md#mongodb-dbcommand-dbcmd.distinct), or [`aggregate`](https://www.mongodb.com/docs/manual/reference/command/aggregate.md#mongodb-dbcommand-dbcmd.aggregate) command, and a `$db` field with the database associated with the original command [source]
- If the slow query log contains consecutive [`$match`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/match.md#mongodb-pipeline-pipe.-match) stages in the aggregation pipeline, the two stages can [coalesce](https://www.mongodb.com/docs/manual/core/aggregation-pipeline-optimization/#-match----match-coalescence) into the first [`$match`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/match.md#mongodb-pipeline-pipe.-match) stage and result in a single [`$match`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/match.md#mongodb-pipeline-pipe [source]
- If the slow query log contains consecutive $match stages in the aggregation pipeline, the two stages can coalesce into the first $match stage and result in a single $match stage. As a result, the query shape in the Performance Advisor might differ from the actual query you ran. [source]
- | Field | Type | Description | | --- | --- | --- | | `aggregate` | string | The name of the collection or view that acts as the input for the aggregation pipeline. Use `1` for collection agnostic commands. | | `pipeline` | array | An array of aggregation pipeline stages that process and transform the document stream as part of the aggregation pipeline. | | `explain` | boolean | Optional. Specifies to return the information on the processing of the pipeline. Not available in [multi-document transactions.](https://www.mongodb.com/docs/manual/core/transactions.md#std-label-transactions) | | `allo [source]
- If you create this index, you remove the need for the database engine to scan the entire collection to find documents that match the query, which improves performance. Queries with the shape shown in the [example](https://www.mongodb.com/docs/atlas/performance-advisor/index-ranking.md#std-label-taxi-example-query) return results in 50 milliseconds or less on the indexed collection, as opposed to several seconds on the unindexed collection. [source]
- - Keys Examined (`keysExamined`): Number of index keys scanned for the query. If this metric is `0` for a query that includes filter conditions, it's highly likely there is no index and MongoDB scanned the entire collection. This is a primary cause of slowness. If Docs Examined is very high and Keys Examined is `0` or very low compared to Docs Examined, you're likely scanning the collection or a very unselective index. To learn more, see [Indexes.](https://www.mongodb.com/docs/manual/indexes.md#std-label-indexes) [source]
- Given these queries, the index with the [partial filter expression](https://www.mongodb.com/docs/manual/core/index-partial.md#std-label-partial-index-query-coverage) can support query operation 2 but *not* support query operation 1. Since the indexes available to support query operation 1 differs from query operation 2, the two queries have different `planCacheKey`. [source]
- | Field Name | Description | | --- | --- | | `ns` | The [namespace](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-namespace) of the requested collection or view. | | `shard` | The name of the shard the output document corresponds to. Only present when `$collStats` runs on a sharded cluster. Both [sharded and non-sharded collections](https://www.mongodb.com/docs/manual/sharding.md#std-label-sharded-vs-non-sharded-collections) will produce this field. | | `host` | The hostname and port of the `mongod` process which produced the output document. | | `localTime` | The current [source]
- Indexes improve read performance, but a large number of indexes can negatively impact write performance since indexes must be updated during writes. If your collection already has several indexes, consider this tradeoff of read and write performance when deciding whether to create new indexes. Examine whether a query for such a collection can be modified to take advantage of existing indexes, as well as whether a query occurs often enough to justify the cost of a new index. [source]
- | Parameter | Type | Description | | --- | --- | --- | | `unique` | boolean | Optional. Specifies that each index specified in the `keyPatterns` array is a [unique index](https://www.mongodb.com/docs/manual/core/index-unique.md#std-label-index-type-unique). Unique indexes will not accept insertion or update of documents where the index key value matches an existing value in the index. Specify `true` to create a unique index. The default value is `false`. The option is *unavailable* for [hashed indexes.](https://www.mongodb.com/docs/manual/core/indexes/index-types/index-hashed.md#std-label-inde [source]
- | Metric | Description | | --- | --- | | `totalPass` | Total number of deletion passes completed by the purging job. | | `docsDeleted` | Cumulative number of pre-image documents deleted by the purging job. **Changed in version 9.0** Starting in MongoDB 9.0, when size and count information is not available for the `config.system.preimages` collection, MongoDB reports this value as an estimate rather than an exact count. | | `bytesDeleted` | Cumulative size in bytes of all deleted documents from all pre-image collections by the purging job. **Changed in version 9.0** Starting in MongoDB 9.0, whe [source]
- The total number of cursors that have been opened since [`mongos`](https://www.mongodb.com/docs/manual/reference/program/mongos.md#mongodb-binary-bin.mongos) started, including cursors currently open. Differs from [`metrics.cursor.open.total`](https://www.mongodb.com/docs/manual/reference/command/serverstatus.md#mongodb-serverstatus-serverstatus.metrics.cursor.open.total), which is the number of currently open cursors only. [source]
- The total number of cursors that have been opened since the server process started, including cursors currently open. Differs from [`metrics.cursor.open.total`](https://www.mongodb.com/docs/manual/reference/command/serverstatus.md#mongodb-serverstatus-serverstatus.metrics.cursor.open.total), which is the number of currently open cursors only. [source]
- Even though only six hours passed between the two dates, `$dateDiff` returns `1` because the dates fall in different calendar years. This reflects the fact that `$dateDiff` counts unit boundaries crossed rather than elapsed duration. [source]
- To use an access token instead of service account credentials, specify the `accessToken` field: [source]
- Also enables or disables MongoDB Cloud-managed slow operation thresholds. To view field values in a sample query, you must have the Project Data Access Read Only role or higher. Otherwise, MongoDB Cloud returns redacted data rather than the field values. [source]
- - The Atlas [Query Profiler](https://www.mongodb.com/docs/atlas/tutorial/query-profiler.md#std-label-query-profiler) records operations that Atlas considers slow when compared to average execution time for all operations on your cluster. [source]
- Starting in MongoDB 8.0, slow operations are logged based on the time that MongoDB spends working on that operation, rather than the total latency for the operation. [source]
- The Query Profiler differs from the [Database Profiler](https://www.mongodb.com/docs/manual/tutorial/manage-the-database-profiler/). The Query Profiler identifies specific inefficient queries based on entries from your `mongod` logs. The Database Profiler returns detailed information about commands executed on the `mongod` based on the specified [profiling level](https://www.mongodb.com/docs/manual/tutorial/manage-the-database-profiler/#profiling-levels). Changing the profiling level doesn't impact the slow queries displayed in the Query Profiler. [source]
- The Atlas Query Profiler records operations that Atlas considers slow when compared to average execution time for all operations on your cluster. [source]
Facts and statements
- atlas api performanceAdvisor listSuggestedIndexes` is autogenerated and corresponds 1:1 with the Admin API v2 operation listGroupProcessPerformanceAdvisorSuggestedIndexes. It requires --groupId and --processId (host:port of a mongod/mongos) and accepts --since, --duration (ms), --namespaces, --nIndexes, --nExamples, --itemsPerPage, --pageNum. [source]
- If neither --duration nor --since is given, listSuggestedIndexes and listSlowQueryLogs return data from the previous 24 hours; an empty result can simply mean a quiet window or a wrong --namespaces filter. [source]
- The CLI toggle is `atlas performanceAdvisor slowOperationThreshold enable|disable` (project-wide); the autogenerated equivalents are `atlas api performanceAdvisor enableManagedSlowMs|disableManagedSlowMs|getManagedSlowMs`, the last reporting current state. [source]
- In the event of a rolling index build cancellation, Atlas generates an [activity feed event](https://www.mongodb.com/docs/atlas/tutorial/activity-feed.md#std-label-view-activity-feed) and sends a notification email to the project owner with the following information: [source]
- In the Database Monitoring Tools section, toggle Performance Advisor and Profiler to Off. [source]
- - [atlas api performanceAdvisor listClusterSuggestedIndexes](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-performanceadvisor-listclustersuggestedindexes.md#std-label-atlas-api-performanceAdvisor-listClusterSuggestedIndexes) - Returns the indexes that the Performance Advisor suggests. [source]
- - [atlas api performanceAdvisor listDropIndexSuggestions](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-performanceadvisor-listdropindexsuggestions.md#std-label-atlas-api-performanceAdvisor-listDropIndexSuggestions) - Returns the indexes that the Performance Advisor suggests to drop. [source]
- - [atlas api performanceAdvisor listSchemaAdvice](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-performanceadvisor-listschemaadvice.md#std-label-atlas-api-performanceAdvisor-listSchemaAdvice) - Returns the schema suggestions that the Performance Advisor detects. [source]
- - [atlas api performanceAdvisor listSuggestedIndexes](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-performanceadvisor-listsuggestedindexes.md#std-label-atlas-api-performanceAdvisor-listSuggestedIndexes) - Returns the indexes that the Performance Advisor suggests. [source]
- The Atlas Performance Advisor page displays hidden indexes from your top 20 most active namespaces at the time you load the page. If you have more than 20 namespaces, the Performance Advisor page might not display all of your namespaces with hidden indexes. [source]
- View real-time performance metrics for a specific Atlas cluster in a project. [source]
- Pipeline stages that require more than 100 megabytes of memory to execute write temporary files to disk by default. These temporary files last for the duration of the pipeline execution and can influence storage space on your instance. [source]
- - To query a view, you must have the `find` privilege on the view namespace. You don't need the `find` privilege on the source collection or any namespaces referenced in the view pipeline. [source]
- An aggregation pipeline can use [indexes](https://www.mongodb.com/docs/manual/indexes.md#std-label-indexes) from the input collection to improve performance. Using an index limits the amount of documents a stage processes. Ideally, an index can [cover](https://www.mongodb.com/docs/manual/core/query-optimization.md#std-label-read-operations-covered-query) the stage query. A covered query has especially high performance, since the index returns all matching documents. [source]
- Longest duration of time in milliseconds that a query operation exceeded the expected execution ticket acquisition time. [source]
- In the Atlas Administration API, the alert configuration stores the override in the `severityOverride` field, and each open alert stores the resolved value in the `severity` field. The [Return All Project Alerts](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-listgroupalerts) and [Return One Alert](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-getgroupalert) endpoints return the resolved `severity`, which matches the severity that Atlas includes in webhook, PagerDuty, and Opsgenie notification payloads. [source]
- - **Scalability:** You can automatically scale your Atlas cluster based on usage. You can also configure granular scaling for compute, IOPS, and storage. [source]
- Atlas gathers metrics data at a 1-minute granularity unless you qualify for premium monitoring. However, Atlas gathers Replication Lag and Replication Headroom metrics at an 85-second granularity. [source]
- Atlas provides several metrics for monitoring and alerting. You can track the health, availability, consumption, and performance of your deployments in visual dashboards and by API (Application Programming Interface). You can also view various cluster metrics, monitor your database performance, configure alerts and alert notification, and download activity logs. [source]
- Performance insights are enabled automatically. [source]
- - The [Real-Time Performance Panel](https://www.mongodb.com/docs/atlas/real-time-performance-panel.md#std-label-real-time-metrics-status-tab) monitors and displays current network traffic and database operations on machines hosting MongoDB in your Atlas clusters. [source]
- If you have at least one cluster that's `M40` or larger, Atlas automatically enables premium monitoring for all clusters in the project. With premium monitoring enabled, Atlas gathers metrics data at a 10-second granularity. Premium monitoring remains enabled for all clusters in the project until you downgrade or terminate your last `M40` cluster. [source]
- Atlas provides several tools that allow you to proactively monitor and improve the performance of your database. [source]
- The Namespace Insights page in the Atlas UI allows you to monitor collection-level performance and usage metrics. It displays metrics (such as the number of CRUD operations on the collection) and statistics (like average query execution time) for certain hosts and operation types for the collections that you [pin for monitoring](https://www.mongodb.com/docs/atlas/namespace-insights/#manage-pinned-namespaces-from-the-dialog). This gives you more granular visibility into collection-level performance, which you can use to optimize database performance, resolve issues, and make decisions about sca [source]
- - For `$lookup`, omit the `from` field if you use a subpipeline with a stage which doesn't require a specified collection. For example, a [`$documents`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/documents.md#mongodb-pipeline-pipe.-documents) stage. [source]
- - For a `$lookup` that starts with a stage for a collection, for example a [`$match`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/match.md#mongodb-pipeline-pipe.-match) or [`$collStats`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/collstats.md#mongodb-pipeline-pipe.-collStats) subpipeline, you must include the `from` field and specify the collection. [source]
- Atlas stores metrics data at various granularity levels. For each granularity level, Atlas computes metrics as averages of the reported metrics at the next finer granularity level. [source]
- The Organization Activity Feed and Project Activity Feed in the Atlas UI list all events that occur for a given Atlas organization or project, respectively. You can filter each activity feed for event type and time range to monitor events such as API access updates, alert configuration changes, and more. This allows you to review activity records for your organization or project at your desired level of granularity. [source]
- - On clusters running MongoDB 8.x, Atlas records up to 100 read queries per second on each host. Atlas does not collect write operations. [source]
- How Atlas Collects Query Shape Statistics [source]
- - View and analyze [performance metrics](https://www.mongodb.com/docs/atlas/monitor-cluster-metrics.md#std-label-monitor-cluster-metrics) that Atlas collects about your cluster. [source]
- - [atlas alerts settings disable](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-alerts-settings-disable.md#std-label-atlas-alerts-settings-disable) - Disables one alert configuration for the specified project. [source]
- You can use Atlas Kubernetes Operator to monitor your Atlas database deployments with the following features. [source]
- Test Failover is usually the preferable solution, but another possible solution is to restart the application currently making connections to your Atlas cluster. Restarting the application terminates all existing connections and allows the Atlas cluster to resume normal operations. [source]
- Atlas collects and displays metrics for your servers, databases, and MongoDB processes. [source]
- Returns the schema suggestions that the Performance Advisor detects. [source]
- 3. Click Performance Advisor. [source]
- The Performance Advisor fetches index recommendations from the past 24 hours. [source]
- - If the Performance Advisor has recommendations, click View Recommendations button in the Create Indexes section. [source]
- - If the Performance Advisor has no recommendations, to look up index recommendations for up to the past 5 days, click Explore Recommendations in the Create Indexes section. [source]
- The Performance Advisor ranks the indexes according to their Impact, which is based on the total wasted bytes read by the associated operations. To learn more about index ranking, see [Review Index Ranking.](https://www.mongodb.com/docs/atlas/performance-advisor/index-ranking.md#std-label-pa-index-ranking) [source]
- You can access the Performance Advisor with the [MongoDB MCP Server](https://www.mongodb.com/docs/mcp-server.md#std-label-what-is-mcp-server). This tool enables you to interact with your Atlas clusters in natural language from AI clients like Claude, Cursor, and Github Copilot. [source]
- The Performance Advisor ranks the indexes according to their Impact, which is based on the total wasted bytes read by the associated operations. To learn more about how the Performance Advisor ranks indexes, see [Review Index Ranking.](https://www.mongodb.com/docs/atlas/performance-advisor/index-ranking.md#std-label-pa-index-ranking) [source]
- | Metric | Description | | --- | --- | | Execution Count | Number of queries executed per hour which would be improved. | | Average Execution Time | Current average execution time in milliseconds for affected queries. | | Average Query Targeting | Average number of documents read per document returned by affected queries. A higher query targeting score indicates a greater degree of inefficiency. For more information on query targeting, see [Query Targeting.](https://www.mongodb.com/docs/atlas/performance-advisor.md#std-label-query-targeting) | | In Memory Sort | Current number of affected quer [source]
- For each suggested index, the Performance Advisor shows the most commonly executed query shapes that the index would improve. For each query shape, the Performance Advisor displays the following metrics: [source]
- | Metric | Description | | --- | --- | | Execution Count | Number of queries executed per hour which match the query shape. | | Average Execution Time | Average execution time in milliseconds for queries which match the query shape. | | Average Query Targeting | Average number of documents read for every document returned by matching queries. A higher query targeting score indicates a greater degree of inefficiency. For more information on query targeting, see [Query Targeting.](https://www.mongodb.com/docs/atlas/performance-advisor.md#std-label-query-targeting) | | Average Docs Scanned | Aver [source]
- The Performance Advisor also shows each executed sample query that matches the query shape, with specific metrics for that query. [source]
- By default, the Performance Advisor suggests indexes for all clusters in the deployment. To only show suggested indexes from a specific collection, use the Collection dropdown at the top of the Performance Advisor. [source]
- Log analysis rate limits apply only to the Performance Advisor UI, the Query Insights UI, and the Access Tracking UI. [Downloadable log files](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-downloadgroupclusterlog) are always complete. [source]
- The Performance Advisor doesn't provide performance suggestions for time series collections. [source]
- The Performance Advisor includes a user feedback button for Index Suggestions on dedicated clusters. [source]
- - You can only create one index at a time through the Performance Advisor. If you want to create more simultaneously, you can do so using the [Atlas UI](https://www.mongodb.com/docs/atlas/atlas-ui/indexes.md#std-label-atlas-ui-indexes), a [driver](https://www.mongodb.com/docs/atlas/driver-connection.md#std-label-connect-via-driver), or the [shell](https://www.mongodb.com/docs/atlas/mongo-shell-connection.md#std-label-connect-mongo-shell) [source]
- - Atlas always creates indexes for entire clusters. If you create an index while viewing the Performance Advisor for a single shard in a sharded cluster, Atlas creates that index for the entire sharded cluster. [source]
- The Performance Advisor opens the Create Index dialog box and prepopulates the Fields based on the index you selected. [source]
- Returns the indexes that the Performance Advisor suggests. [source]
- | Name | Type | Required | Description | | --- | --- | --- | --- | | -h, --help | | false | help for performanceAdvisor | [source]
- The Performance Advisor orders the [indexes](https://www.mongodb.com/docs/manual/indexes/) that it suggests by their respective Impact. Impact indicates the estimated performance improvement that the suggested index would bring. [source]
- The Performance Advisor monitors queries that take longer than `100` milliseconds to execute and groups these queries into common [query shapes](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-query-shape). The Performance Advisor calculates the inefficiency of each query shape by considering the following aggregated metrics from queries which match the shape: [source]
- The type of query operation in the query shape affects the order of the fields used to construct the index. In general, the Performance Advisor ranks fields by their [cardinality.](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-cardinality) [source]
- The Performance Advisor doesn't suggest indexes that have more than 16 fields. [source]
- Also, the Performance Advisor suggests the index only if the difference between scanned documents and returned documents is greater than 500 for impacted queries. [source]
- The Performance Advisor de-duplicates overlapping indexes before it makes suggestions. For example, consider if the Performance Advisor calculates the following potential suggested indexes: [source]
- The Performance Advisor lists recommended indexes in order of performance impact, from greatest to least. [source]
- Click the Create Index button to create the index with any desired additional options. To learn more about creating an index in the Performance Advisor, see [Create Suggested Indexes.](https://www.mongodb.com/docs/atlas/performance-advisor.md#std-label-pa-create-suggested-indexes) [source]
- - Consider the suggested indexes from the [Performance Advisor](https://www.mongodb.com/docs/atlas/performance-advisor.md#std-label-performance-advisor) with the highest Impact scores and lowest Average Query Targeting scores. [source]
- - [Drop unused, redundant, and hidden indexes](https://www.mongodb.com/docs/atlas/performance-advisor/drop-indexes.md#std-label-pa-drop-index) to improve write performance and free storage space. [source]
- The Performance Advisor orders the indexes that it suggests by their respective Impact. Impact indicates the estimated performance improvement that the suggested index would bring. [source]
- How Performance Advisor Suggests and Ranks Indexes [source]
- The type of query operation in the query shape affects the order of the fields used to construct the index. In general, the Performance Advisor ranks fields by their cardinality. [source]
- Click the Create Index button to create the index with any desired additional options. To learn more about creating an index in the Performance Advisor, see Create Suggested Indexes. [source]
- The Performance Advisor suggests dropping unused, redundant, and hidden indexes to improve write performance and increase storage space. [source]
- The Performance Advisor flags an index as unused if it hasn't supported a query in 7 or more days after it was created or the server was restarted. [source]
- The Performance Advisor inspects only the 20 most active collections for unused indexes. [source]
- The Performance Advisor flags an index as redundant if it matches the prefix of another index in the same collection. [source]
- In the Performance Advisor, redundant indexes are marked with a red `Redundant` badge. Below each redundant index, the Performance Advisor displays the related indexes that cover it. [source]
- The Performance Advisor always recommends dropping hidden indexes. If you determine that a hidden index is unnecessary, drop it. [source]
- Consider [hiding indexes](https://www.mongodb.com/docs/atlas/performance-advisor/drop-indexes.md#std-label-hidden-indexes) before you drop them. [source]
- In the Performance Advisor tab, click Explore Recommendations on the Drop Indexes card. [source]
- The Performance Advisor displays a dialog box with a link to the [Atlas UI](https://www.mongodb.com/docs/atlas/atlas-ui/indexes.md#std-label-atlas-ui-indexes) and a copyable [MongoDB Shell](https://www.mongodb.com/docs/mongodb-shell/) command to drop that index. [source]
- | Name | Type | Required | Description | | --- | --- | --- | --- | | -h, --help | | false | help for slowOperationThreshold | [source]
- Access Performance Advisor with the MCP server [source]
- The Performance Advisor ranks the indexes according to their Impact, which is based on the total wasted bytes read by the associated operations. To learn more about how the Performance Advisor ranks indexes, see Review Index Ranking. [source]
- Log analysis rate limits apply only to the Performance Advisor UI, the Query Insights UI, and the Access Tracking UI. Downloadable log files are always complete. [source]
- You can only create one index at a time through the Performance Advisor. If you want to create more simultaneously, you can do so using the Atlas UI, a driver, or the shell [source]
- - **Performance:** You can use built-in tools like Query Insights and Performance Advisor to optimize performance, improve database operations, and manage costs. [source]
- After you've configured the MongoDB MCP Server and connected it to your Atlas cluster, you can use natural language to retrieve Performance Advisor recommendations. The following table illustrates example prompts that you can use: [source]
- 2. Toggle the button next to Performance Advisor and Profiler. [source]
- Returns the indexes that the Performance Advisor suggests to drop. [source]
- The Real-Time Performance Panel (RTPP) in the Atlas UI provides insights into current network traffic, database operations, and hardware statistics about the hosts at a one second granularity in the Atlas UI. We recommend that you use RTPP (Real-Time Performance Panel) to: [source]
- - [atlas alerts settings enable](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-alerts-settings-enable.md#std-label-atlas-alerts-settings-enable) - Enables one alert configuration for the specified project. [source]
- - Restart the application which is currently making connections to your Atlas cluster. Restarting the application terminates all existing connections opened by the application and allows the Atlas cluster to resume normal operations. [source]
- Platform AtlasBuild with the intelligent data platform [source]
- You can use Atlas Kubernetes Operator to configure alerts to help you monitor access to and the state of the database deployments in your Atlas projects. [source]
- If you are working with an existing cluster, you must have [`Project Data Access Admin`](https://www.mongodb.com/docs/atlas/reference/user-roles.md#mongodb-authrole-Project-Data-Access-Admin) or higher [access](https://www.mongodb.com/docs/atlas/access/manage-project-access.md#std-label-who-can-access-project) to your Atlas project. [source]
- The Clusters view displays all the clusters in an Atlas project and features core metrics per cluster. You can also view core metrics for a specific cluster on the Overview tab. [source]
- On deployments that require [authentication](https://www.mongodb.com/docs/manual/core/authentication/), to stop operations that you don't own, you must have the [`killop`](https://www.mongodb.com/docs/manual/reference/privilege-actions.md#mongodb-authaction-killop) privilege action. [source]
- - If you see `"planSummary": "COLLSCAN":` in the query log, the query performed a collection scan and did not use an index. This is a strong signal to add an [index](https://www.mongodb.com/docs/manual/indexes.md#std-label-indexes) or rewrite the query. [source]
- - Tokens Used (`tokensUsed`): The number of tokens used by a [`$rerank`](https://www.mongodb.com/docs/vector-search/query/aggregation-stages/rerank.md#mongodb-pipeline-pipe.-rerank) stage in the operation. If this metric is consistently high, consider reducing `numDocsToRerank`, or reducing the fields specified in `path` that have large values. Use the filter With Rerank Stage and Without Rerank Stage to filter for operations with a `$rerank` stage. [source]
- - Uses Index (`usedIndex`): This boolean confirms whether a MongoDB index was used. If set to `false` for a query that should be indexed, add an [index.](https://www.mongodb.com/docs/manual/indexes.md#std-label-indexes) [source]
- - **Atlas Core**: the Atlas cluster architecture where compute and storage run on the same node. It is available across Free clusters, Flex clusters, and dedicated cluster tiers. [source]
- - The Namespace Insights tab is supported only for Atlas M10+ clusters. [source]
- The indexNames field specifies the names of the indexes. Since the indexes were created without an explicit name, MongoDB generated an index name by concatenating the names of the indexed fields and the sort order. [source]
- The atlas api sub-command is automatically generated from the MongoDB Atlas Admin API and offers full coverage of the Admin API. Admin API capabilities have their own release lifecycle, which you can check via the provided API endpoint documentation link. [source]
- This command is autogenerated and corresponds 1:1 with the Atlas API endpoint [https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-listgroupalerts.](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-listgroupalerts) [source]
- | Name | Type | Required | Description | | --- | --- | --- | --- | | -P, --profile | string | false | Name of the profile to use from your configuration file. To learn about profiles for the Atlas CLI, see [https://dochub.mongodb.org/core/atlas-cli-save-connection-settings.](https://dochub.mongodb.org/core/atlas-cli-save-connection-settings) | [source]
- TTL indexes expire documents after the specified number of seconds has passed since the indexed field value. [source]
- The unique index permits the insertion of the following documents into the collection since the index enforces uniqueness for the *combination* of `a.loc` and `a.qty` values: [source]
- Since `side_a` and `hypotenuse` are stored as [128-bit decimals](https://www.mongodb.com/docs/mongodb-shell/reference/data-types.md#std-label-shell-type-decimal), the output of [`$asin`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/asin.md#mongodb-expression-exp.-asin) is a 128-bit decimal. [source]
- This command is autogenerated and corresponds 1:1 with the Atlas API endpoint [https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-updategroupclustersearchindexbyname.](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-updategroupclustersearchindexbyname) [source]
- This command is autogenerated and corresponds 1:1 with the Atlas API endpoint [https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-getgroupclusterqueryshape.](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-getgroupclusterqueryshape) [source]
- The replacement document can have different fields from the original document. In the replacement document, you can omit the `_id` field since the `_id` field is immutable; however, if you do include the `_id` field, it must have the same value as the current value. [source]
- This command is autogenerated and corresponds 1:1 with the Atlas API endpoint [https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-downloadgroupclusterlog.](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-downloadgroupclusterlog) [source]
- This command is autogenerated and corresponds 1:1 with the Atlas API endpoint [https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-listgroupclusterperformanceadvisorschemaadvice.](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-listgroupclusterperformanceadvisorschemaadvice) [source]
- Creating the index in this way allows index builds on one replica set member as a standalone at a time, starting with the secondary members. Creating indexes in this way requires at least one replica set election. To use this resource, the requesting Service Account or API Key must have the Project Data Access Admin role. [source]
- This command is autogenerated and corresponds 1:1 with the Atlas API endpoint [https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-creategroupclusterindexrollingindex.](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-creategroupclusterindexrollingindex) [source]
- The duration of the operation in seconds. MongoDB calculates this value by subtracting the current time from the start time of the operation. [source]
- The duration of the operation in microseconds. MongoDB calculates this value by subtracting the current time from the start time of the operation. [source]
- The duration, in microseconds, for the transaction. [source]
- Number of times the server has checked the operation for interrupts since it started. Short running operations return small numbers, preferably 0 or 1. Long running operations show large numbers, as the server has checked several times to determine whether the operation was stopped or timed out. [source]
- You must have the [`Project Owner`](https://docs.atlas.mongodb.com/reference/user-roles/#mongodb-authrole-Project-Owner) role to configure a third-party monitoring integration. [source]
- - A local deployment that is set up using the [Atlas CLI.](https://www.mongodb.com/docs/atlas/cli/stable/atlas-cli-deploy-local/) [source]
- The namespace the operation targets. Namespaces in MongoDB take the form of the database, followed by a dot (.), followed by the name of the collection. [source]
- Don't rely on this field alone to evaluate query-planning performance. Review the total operation duration, keysExamined, docsExamined, and relevant sharding or lock-wait metrics. [source]
- [`Project Owner`](https://www.mongodb.com/docs/atlas/reference/user-roles.md#mongodb-authrole-Project-Owner) users can also manually subscribe to or unsubscribe from Query Shape Reports regardless of whether the project has received a query targeting alert. To learn more, see [Manage Report Subscriptions.](https://www.mongodb.com/docs/atlas/query-shape-insights.md#std-label-query-shape-reports-manage) [source]
- Atlas sends each report to all users with the [`Project Owner`](https://www.mongodb.com/docs/atlas/reference/user-roles.md#mongodb-authrole-Project-Owner) role. [source]
- You can subscribe to or unsubscribe from Query Shape Reports in your project's settings. This setting controls reports for all users in the project. Only users with the [`Project Owner`](https://www.mongodb.com/docs/atlas/reference/user-roles.md#mongodb-authrole-Project-Owner) role can change the subscription, and only [`Project Owner`](https://www.mongodb.com/docs/atlas/reference/user-roles.md#mongodb-authrole-Project-Owner) users receive the reports. [source]
- - **Namespace**: In the Select Namespaces drop-down menu, select one or more namespaces to filter by. [source]
- | Field Name | Description | | --- | --- | | `latency` | The total latency, in microseconds. | | `ops` | The total number of operations performed on the collection since startup. | | `histogram` | An array of embedded documents, each representing a latency range. Each document covers twice the previous document's range. For lower values between 2048 microseconds and roughly 1 second, the histogram includes half-steps. This field only exists given the `latencyStats: { histograms: true }` option. Empty ranges with a zero `count` are omitted from the output. Each document has the following fields [source]
- You must have the Project Read Only or higher role to view the Atlas Search metric types. [source]
- This command is autogenerated and corresponds 1:1 with the Atlas API endpoint [https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-getgrouphostftsmetricindexmeasurements.](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-getgrouphostftsmetricindexmeasurements) [source]
- In the worst case, running metadata compaction reveals the number of unique field/value pairs inserted across all documents since the previous compaction. [source]
- - `docinserts`: the number of documents inserted since the last compaction. [source]
- - `valinserts`: the number of unique field/value pairs inserted since the last compaction. [source]
- The number of encrypted fields per document multiplied by the number of insertions since last compaction, minus the number of unique field/value pairs inserted across all documents since the last compaction, should be greater than or equal to the number of documents to remove from the `ESC`. [source]
- The formula would be satisfied, for example, if 200 documents were inserted since the last compaction with a total of 200 unique field/value pairs across all documents, or if 400 documents were inserted since the last compaction with 700 unique field/value pairs. [source]
- - An OpenAI API Key. You must have an OpenAI account with credits available for API requests. To learn more about registering an OpenAI account, see the [OpenAI API website.](https://openai.com/api/) [source]
- - A Voyage AI API (Application Programming Interface) key. To create an API (Application Programming Interface) key, see [Manage Voyage AI Model API Keys.](https://www.mongodb.com/docs/voyageai/management/api-keys.md#std-label-voyage-api-keys) [source]
- - Your Voyage AI API Key. [source]
- ```python os.environ["OPENAI_API_KEY"] = "<api-key>" MONGODB_URI = "<connection-string>" ``` [source]
- - Queries against internal namespaces, such as `system.*` collections and internal databases [source]
- The duration in seconds between [noop](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-noop) writes on each individual node. [source]
- This behavior only affects read operations that start before the chunk migration commit. It applies to all read operations on secondaries, including queries, aggregations, and operations spanning multiple namespaces. [source]
- The following query can use the index since the query predicate includes the condition `password: { $exists: true }` that matches documents matched by the index filter expression `password: { $exists: true }`: [source]
- - Update operations are rare, since each document represents a single point in time. [source]
- - Data is high volume, since each individual time series requires a large, constantly growing number of documents. [source]
- Compare this to a time series collection. Time series collections write data in order, meaning recent transactions can be kept in memory for much faster retrieval. Since they are written in sequence, documents are stored together, so there's no need to read every disk block after a document is no longer in memory. Data is indexed by the `metaField`, leading to much smaller indexes. [source]
- For installation instructions on other operating systems, see [Install the Atlas CLI](https://www.mongodb.com/docs/atlas/cli/current/install-atlas-cli/) [source]
- The `$listClusterCatalog` aggregation stage is unsupported and is not guaranteed to be stable in a future release. Don't build functionality that relies on a specific output format of this stage, since the output may change in a future release. [source]
- - [atlas api rollingIndex createRollingIndex](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-rollingindex-createrollingindex.md#std-label-atlas-api-rollingIndex-createRollingIndex) - Creates an index on the cluster identified by its name in a rolling manner. [source]
- Since `angle_a`, `angle_b`, and `angle_c` are stored as [128-bit decimals](https://www.mongodb.com/docs/mongodb-shell/reference/data-types.md#std-label-shell-type-decimal), the output of [`$radiansToDegrees`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/radianstodegrees.md#mongodb-expression-exp.-radiansToDegrees) is a 128-bit decimal. [source]
- 1. Register a GCP (Google Cloud Platform) Service Account [source]
- This command is autogenerated and corresponds 1:1 with the Atlas API endpoint [https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-getgroupprocessdiskmeasurements.](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-getgroupprocessdiskmeasurements) [source]
- This command is autogenerated and corresponds 1:1 with the Atlas API endpoint [https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-deletegroupclustersearchindexbyname.](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-deletegroupclustersearchindexbyname) [source]
- Rolling index builds lower the resiliency of your cluster and increase build duration. [source]
- For example, the following operation does not use an index since no index exists on the `price` field to support the match condition: [source]
- This command is autogenerated and corresponds 1:1 with the Atlas API endpoint [https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-acknowledgegroupalert.](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-acknowledgegroupalert) [source]
- 3. Ensure your database user has [`dbAdmin`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-dbAdmin) permissions on the following namespaces: [source]
- Since `x-coordinate` is stored as a [128-bit decimal](https://www.mongodb.com/docs/mongodb-shell/reference/data-types.md#std-label-shell-type-decimal), the output of [`$atanh`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/atanh.md#mongodb-expression-exp.-atanh) is a 128-bit decimal. [source]
- | Input Type | Behavior | | --- | --- | | Double | Returns a date that corresponds to the number of milliseconds represented by the truncated double value. Positive number corresponds to the number of milliseconds since Jan 1, 1970. Negative number corresponds to the number of milliseconds before Jan 1, 1970. | | Decimal | Returns a date that corresponds to the number of milliseconds represented by the truncated decimal value. Positive number corresponds to the number of milliseconds since Jan 1, 1970. Negative number corresponds to the number of milliseconds before Jan 1, 1970. | | Long | Ret [source]
- - [atlas api alerts acknowledgeAlert](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-alerts-acknowledgealert.md#std-label-atlas-api-alerts-acknowledgeAlert) - Confirms receipt of one existing alert. [source]
- - Use the Atlas Administration API to [pull log data](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/group/endpoint-monitoring-and-logs) every 5 minutes or [pull monitoring data.](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/group/endpoint-monitoring-and-logs) [source]
- Previous versions of MongoDB supported building indexes either in the foreground or background. Foreground index builds were fast and produced more efficient index data structures, but required blocking all read-write access to the parent database of the collection being indexed for the duration of the build. Background index builds were slower and produced less efficient results, but allowed read-write access to the database and its collections during the build. [source]
- - A Voyage AI API key. To learn more, see [Voyage AI Documentation.](https://docs.voyageai.com/docs/api-key-and-installation) [source]
- You can use the Atlas UI, Atlas Administration API, and Atlas CLI to view Atlas cluster metrics. Additionally, Atlas provides built-in integrations with third-party tools such as [Datadog](https://www.mongodb.com/docs/atlas/tutorial/datadog-integration.md#std-label-datadog-integration) and [Prometheus](https://www.mongodb.com/docs/atlas/tutorial/prometheus-integration.md#std-label-prometheus-integration), and you can also leverage the Atlas Administration API to integrate with other custom metrics tools. [source]
- You use the Atlas UI, Atlas CLI, and Atlas Administration API to retrieve events from each activity feed. To learn more, see [View Activity Feed.](https://www.mongodb.com/docs/atlas/tutorial/activity-feed.md#std-label-activity-feed) [source]
- Atlas retains the last 30 days of log messages and system event audit messages. You can download Atlas logs at any point until the end of their retention periods by using the Atlas UI, Atlas Administration API, and Atlas CLI. [source]
- For example, the following trims any `g` and `e` from the end of the input string. Since the input ends with a whitespace, neither character can be trimmed from the end of the string. [source]
- [`db.collection.dropIndex()`](https://www.mongodb.com/docs/manual/reference/method/db.collection.dropindex.md#mongodb-method-db.collection.dropIndex) obtains an exclusive lock on the specified collection for the duration of the operation. All subsequent operations on the collection must wait until [`db.collection.dropIndex()`](https://www.mongodb.com/docs/manual/reference/method/db.collection.dropindex.md#mongodb-method-db.collection.dropIndex) releases the lock. [source]
- You can download logs of your federated database instance queries from the Atlas CLI, Atlas UI, and API (Application Programming Interface). You can view the logs to determine information such as: [source]
- The server always uses an index for the `$geoNear` stage, since it requires a [geospatial index.](https://www.mongodb.com/docs/manual/geospatial-queries.md#std-label-index-feature-geospatial) [source]
- Count of **all** incoming connections created to the server. This number includes connections that have since closed. [source]
- The time, in microseconds, since the database last started and created the [`globalLock`](https://www.mongodb.com/docs/manual/reference/command/serverstatus.md#mongodb-serverstatus-serverstatus.globalLock). This is approximately equivalent to the total server uptime. [source]
- A document that reports statistics on all indexes on databases and collections in non-system namespaces only. `indexStats` does not report statistics on indexes in the `admin`, `local`, and `config` databases. [source]
- The number of all active local sessions cached in memory by the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) or [`mongos`](https://www.mongodb.com/docs/manual/reference/program/mongos.md#mongodb-binary-bin.mongos) instance since the last refresh period. [source]
- The total number of cursors that have returned more than one batch since [`mongos`](https://www.mongodb.com/docs/manual/reference/program/mongos.md#mongodb-binary-bin.mongos) started. Additional batches are retrieved using the [`getMore`](https://www.mongodb.com/docs/manual/reference/command/getmore.md#mongodb-dbcommand-dbcmd.getMore) command. [source]
- Total number of interrupt checks performed since the server started. [source]
- - The sync source's majority commit point has advanced since the last batch sent to this secondary. [source]
- The total number of accepted incoming TCP Fast Open (TFO) connections to the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) or [`mongos`](https://www.mongodb.com/docs/manual/reference/program/mongos.md#mongodb-binary-bin.mongos) since the `mongod` or `mongos` last started. [source]
- A document that reports on the [read concern level](https://www.mongodb.com/docs/manual/reference/read-concern.md#std-label-read-concern-levels) specified by query operations to the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) instance since it last started. [source]
- A document that reports on the [write concerns](https://www.mongodb.com/docs/manual/reference/write-concern.md#std-label-write-concern) specified by write operations to the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) instance since it last started. [source]
- A document that reports on the [w: \<value>](https://www.mongodb.com/docs/manual/reference/write-concern.md#std-label-wc-w) specified by insert operations to the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) instance since it last started: [source]
- A document that reports on the [w: \<value>](https://www.mongodb.com/docs/manual/reference/write-concern.md#std-label-wc-w) specified by update operations to the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) instance since it last started: [source]
- A document that reports on the [w: \<value>](https://www.mongodb.com/docs/manual/reference/write-concern.md#std-label-wc-w) specified by delete operations to the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) instance since it last started: [source]
- A document that reports on database operations by type since the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) instance last started. [source]
- The total number of [`insert`](https://www.mongodb.com/docs/manual/reference/command/insert.md#mongodb-dbcommand-dbcmd.insert) operations received since the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) instance last started. [source]
- The total number of queries received since the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) instance last started. [source]
- The total number of [`update`](https://www.mongodb.com/docs/manual/reference/command/update.md#mongodb-dbcommand-dbcmd.update) operations received since the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) instance last started. [source]
- The total number of [`delete`](https://www.mongodb.com/docs/manual/reference/command/delete.md#mongodb-dbcommand-dbcmd.delete) operations since the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) instance last started. [source]
- The total number of commands issued to the database since the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) instance last started. [source]
- The total number of [`aggregate`](https://www.mongodb.com/docs/manual/reference/command/aggregate.md#mongodb-dbcommand-dbcmd.aggregate) operations since the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) instance last started. [source]
- A document that reports on database replication operations by type since the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) instance last started. [source]
- The total number of replicated insert operations since the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) instance last started. [source]
- The total number of replicated queries since the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) instance last started. [source]
- The total number of replicated update operations since the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) instance last started. [source]
- The total number of replicated delete operations since the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) instance last started. [source]
- The total number of replicated commands issued to the database since the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) instance last started. [source]
- An array of the current replica set members' hostname and port information (`"host:port"`). [source]
- The hostname and port information (`"host:port"`) of the current [primary](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-primary) member of the replica set. [source]
- The hostname and port information (`"host:port"`) for the current member of the replica set. [source]
- The number of times write-blocking is enabled with the reason `Unspecified` since the server started. [source]
- The number of times write-blocking is enabled with the reason `ClusterToClusterMigrationInProgress` since the server started. [source]
- The number of times write-blocking is enabled with the reason `DiskUseThresholdExceeded` since the server started. [source]
- Number of times the shard cleared the in-memory collection sharding metadata cache since the server started. [source]
- Number of times the shard set the in-memory collection sharding metadata cache since the server started. [source]
- Number of completed recoveries of collection sharding metadata from the shard's durable shard catalog since the server started. [source]
- Number of `invalidateAllCollectionMetadata` [oplog](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-oplog) entries applied by this node since the server started. Applying this entry clears in-memory collection sharding metadata for all collections on the shard. [source]
- Number of `invalidateCollectionMetadata` [oplog](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-oplog) entries applied by this node since the server started. [source]
- Number of applied `invalidateCollectionMetadata` [oplog](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-oplog) entries that cleared metadata for dropped or untracked collections since the server started. This value is a subset of the [`countInvalidateCollectionMetadataOplogEntriesApplied`](https://www.mongodb.com/docs/manual/reference/command/serverstatus.md#mongodb-serverstatus-serverstatus.shardingStatistics.collectionShardingMetadataStatistics.countInvalidateCollectionMetadataOplogEntriesApplied) server status. [source]
- Number of collection metadata entries cloned into the shard's local catalog during feature compatibility version (FCV) upgrade since the server started. [source]
- Number of collection metadata entries dropped from the shard's local catalog since the server started. [source]
- Number of collection metadata entries renamed in the shard's local catalog since the server started. [source]
- Number of metadata synchronizers the shard created to recover collection sharding metadata since the server started. [source]
- Number of `setAllowChunkOperations` [oplog](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-oplog) entries that this node has applied since the server started. [source]
- Total number of changed chunks merged by the `updateCollectionMetadata` [oplog](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-oplog) entries that this node has applied since the server started. [source]
- Number of `updateCollectionMetadata` [oplog](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-oplog) entries that this node has applied since the server started. [source]
- Number of shard version mismatches that the shard resolved since the server started, whether from cached metadata, after recovery from disk, or after a config time wait. [source]
- Total number of chunks read from the shard's durable shard catalog across all collection sharding metadata recoveries since the server started. [source]
- Cumulative time, in milliseconds, that the shard spent recovering collection sharding metadata from disk since the server started. [source]
- Cumulative time, in milliseconds, that the shard spent in post-recovery waits since the server started. [source]
- Number of `createDatabaseMetadata` [oplog](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-oplog) entries that this node has applied since the server started. [source]
- Number of transitions between read and write access on database metadata since the server started. [source]
- Number of times the shard cleared the in-memory database sharding metadata cache since the server started. [source]
- Number of times the shard set the in-memory database sharding metadata cache since the server started. [source]
- Number of times the shard waited for a received database version to become majority-committed after a database version mismatch since the server started. [source]
- Number of `dropDatabaseMetadata` [oplog](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-oplog) entries that this node applied since the server started. [source]
- Number of `invalidateAllDatabaseMetadata` [oplog](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-oplog) entries applied by this node since the server started. Applying this entry clears in-memory database sharding metadata for all databases on the shard. [source]
- Number of database metadata entries cloned into the shard's local catalog during feature compatibility version (FCV) upgrade since the server started. [source]
- Number of database metadata entries dropped from the shard's local catalog since the server started. [source]
- Number of persisted writes (inserts, updates, and deletes) made to the shard catalog's databases collection since the server started. [source]
- Cumulative time in milliseconds that the shard spent waiting after database version mismatches since the server started. [source]
- For update and delete commands, since only single document operations are retryable, there is one write per statement. [source]
- For the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod), the total number of transactions aborted on this instance since its last startup. [source]
- For the [`mongos`](https://www.mongodb.com/docs/manual/reference/program/mongos.md#mongodb-binary-bin.mongos), the total number of transactions aborted through this instance since its last startup. [source]
- For the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod), the total number of transactions committed on the instance since its last startup. [source]
- For the [`mongos`](https://www.mongodb.com/docs/manual/reference/program/mongos.md#mongodb-binary-bin.mongos), the total number of transactions committed through this instance since its last startup. [source]
- For the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod), the total number of transactions started on this instance since its last startup. [source]
- For the [`mongos`](https://www.mongodb.com/docs/manual/reference/program/mongos.md#mongodb-binary-bin.mongos), the total number of transactions started on this instance since its last startup. [source]
- The total number of shards contacted for all transactions started through this [`mongos`](https://www.mongodb.com/docs/manual/reference/program/mongos.md#mongodb-binary-bin.mongos) since its last startup. [source]
- Total number of shards involved in the commit for all transactions started through this [`mongos`](https://www.mongodb.com/docs/manual/reference/program/mongos.md#mongodb-binary-bin.mongos) since its last startup. [source]
- The number of times the directories have been checked since startup. Directories are checked multiple times every `monitoringPeriod`. [source]
- There are also restrictions on using [`mongoimport`](https://www.mongodb.com/docs/database-tools/mongoimport.md#mongodb-binary-bin.mongoimport) and [`mongoexport`](https://www.mongodb.com/docs/database-tools/mongoexport.md#mongodb-binary-bin.mongoexport) with periods (`.`) in field names. Since CSV files use the period (`.`) to represent data hierarchies, a period (`.`) in a field name will be misinterpreted as a level of nesting. [source]
- - Parallel operations. To update multiple namespaces concurrently, consider using the [`bulkWrite`](https://www.mongodb.com/docs/manual/reference/command/bulkwrite.md#mongodb-dbcommand-dbcmd.bulkWrite) command instead. [source]
- In the example operation, the [`db.collection.find()`](https://www.mongodb.com/docs/manual/reference/method/db.collection.find.md#mongodb-method-db.collection.find) method is associated with an explicit session. The cursor is configured with [`noCursorTimeout()`](https://www.mongodb.com/docs/manual/reference/method/cursor.nocursortimeout.md#mongodb-method-cursor.noCursorTimeout) to prevent the server from closing the cursor if idle. The `while` loop includes a block that uses [`refreshSessions`](https://www.mongodb.com/docs/manual/reference/command/refreshsessions.md#mongodb-dbcommand-dbcmd.re [source]
- If you are running with [journaling](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-journal) enabled, there is almost never any need to run repair since the server can use the journal files to restore the data files to a clean state automatically. However, you may need to run repair in cases where you need to recover from a disk-level data corruption. [source]
- Navigate to the [Create One Atlas Search Index](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-creategroupclustersearchindex) section of the Atlas Admin API specification. [source]
- Navigate to the [Update One Atlas Search Index](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-updategroupclustersearchindex) section of the Atlas Admin API specification. [source]
- Encrypting a field with Queryable Encryption and enabling queries on encrypted fields increase the storage that a collection requires. Estimate these increases before you finalize your encryption schema, since changing the increases requires you to re-create the collection. [source]
- Sensitive data is encrypted throughout its lifecycle: in-transit, at-rest, in-use, in logs, and in backups. Data is decrypted only on the client-side, since only you have access to the encryption keys. [source]
- The replication oplog window doesn't need to cover the time needed to restore a replica set member via initial sync as the oplog records are pulled during the data copy. However, the member being restored must have enough disk space in the [local](https://www.mongodb.com/docs/manual/reference/local-database.md#std-label-replica-set-local-database) database to temporarily store these oplog records for the duration of this data copy stage. [source]
- | Data Period | Duration of Retention | | --- | --- | | 10 seconds | 8 hours | | 1 minute | 48 hours | | 5 minutes | 48 hours | | 1 hour | 63 days | | 1 day | Forever | [source]
- - Atlas pauses monitoring for Free clusters which have had no connection activity for 7 days. Monitoring resumes once a successful connection occurs through the Atlas Administration API, [Driver](https://www.mongodb.com/docs/atlas/driver-connection.md#std-label-connect-via-driver), [`mongosh`](https://www.mongodb.com/docs/mongodb-shell.md#mongodb-binary-bin.mongosh), or [Data Explorer.](https://www.mongodb.com/docs/atlas/atlas-ui.md#std-label-atlas-ui) [source]
- Project Owner users can also manually subscribe to or unsubscribe from Query Shape Reports regardless of whether the project has received a query targeting alert. To learn more, see Manage Report Subscriptions. [source]
- Atlas sends each report to all users with the Project Owner role. [source]
- - [Query Shape Reports](https://www.mongodb.com/docs/atlas/query-shape-insights.md#std-label-query-shape-reports), which send a summary of inefficient query shapes to Project Owners by email. [source]
- The [`collMod`](https://www.mongodb.com/docs/manual/reference/command/collmod.md#mongodb-dbcommand-dbcmd.collMod) command obtains a collection lock on the specified collection for the duration of the operation. [source]
- Time that a query with the given key was first used since the last restart [source]
- MongoDB can also use the index to support a query on the `item` and `stock` fields, since the `item` field corresponds to a prefix. However, the index is not as efficient as `{ item: 1, stock: 1 }`. [source]
- Starting in MongoDB 8.0, namespaces in subpipelines within `$lookup` and `$unionWith` are validated to ensure the correct use of `from` and `coll` fields: [source]
- - Since only 3 documents have valid ratings, `$maxN` returns 3 values even though `n = 4`. [source]
- The inequality operator `$ne` is *not* very selective since it often matches a large portion of the index. As a result, in many cases, a `$ne` query with an index may perform no better than a `$ne` query that must scan all documents in a collection. See also [Create Selective Queries.](https://www.mongodb.com/docs/manual/core/query-optimization.md#std-label-read-operations-query-selectivity) [source]
- - **Stale secondary reads**: reads directed to secondaries through a non-[`primary`](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-primary) [read preference](https://www.mongodb.com/docs/manual/core/read-preference.md#std-label-read-preference) may return data that lags behind the primary, since secondaries replicate asynchronously. Secondaries always apply writes in the same order as the primary, so reads may be stale but never out of order. This reflects the [eventual consistency](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-eventual-consistency) mo [source]
- You can configure limits on the amount of data processed for your queries from the Atlas CLI, Atlas UI, and API (Application Programming Interface). [source]
- Indexes have some negative performance impact on write operations. For collections with high write-to-read ratio, indexes are expensive since each insert must also update any indexes. For a detailed list of considerations for indexes, see [Operational Considerations for Indexes.](https://www.mongodb.com/docs/manual/data-modeling/best-practices.md#std-label-data-model-indexes) [source]
- | Name and Definition | The name of the index and keys. | | --- | --- | | Type | Regular, text, geospatial or hashed index. | | Size | How large the index is. | | Usage | Number of times the primary node has used the index in a lookup since the index was created or the last server restart. This metric is for informational purposes only. To get comprehensive index usage statistics across all nodes, run the [`$indexStats`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/indexStats.md#mongodb-pipeline-pipe.-indexStats) aggregation stage on each node. | | Properties | Any specia [source]
- Since MongoDB 4.4, the `find` command ignores the `oplogReplay` flag. If set, the server accepts it for backwards compatibility but ignores it. [source]
- The inequality operator [`$nin`](https://www.mongodb.com/docs/manual/reference/operator/query/nin.md#mongodb-query-op.-nin) is *not* very selective since it often matches a large portion of the index. As a result, in many cases, a [`$nin`](https://www.mongodb.com/docs/manual/reference/operator/query/nin.md#mongodb-query-op.-nin) query with an index may perform no better than a [`$nin`](https://www.mongodb.com/docs/manual/reference/operator/query/nin.md#mongodb-query-op.-nin) query that must scan all documents in a collection. See also [Create Selective Queries.](https://www.mongodb.com/docs/ma [source]
- For the specified index to cover the query, the projection document must explicitly specify _id: 0 to exclude the _id field from the result since the index doesn't include the _id field. [source]
- Once all documents have been processed, the [finalize](https://www.mongodb.com/docs/manual/reference/operator/aggregation/accumulator.md#std-label-accumulator-finalize) function divides the `sum` of the copies by the `count` of documents to obtain the average. This removes the need to keep a running computed average, since the [finalize](https://www.mongodb.com/docs/manual/reference/operator/aggregation/accumulator.md#std-label-accumulator-finalize) function receives the cumulative `sum` and `count` of all documents. [source]
- The [`"available"`](https://www.mongodb.com/docs/manual/reference/read-concern-available.md#mongodb-readconcern-readconcern.-available-) read concern can return [orphaned documents](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-orphaned-document) from secondary members since it does not check for updated chunk metadata. However, if the return of orphaned documents is immaterial to an application, the [`"available"`](https://www.mongodb.com/docs/manual/reference/read-concern-available.md#mongodb-readconcern-readconcern.-available-) read concern provides the lowest latency r [source]
- If you specify a secondary member of a replica set that hasn't received any database read operations, the endpoint doesn't return any namespaces. [source]
- For clusters running an earlier version of MongoDB, you can manage your Atlas Search indexes using the Atlas UI, the [Atlas CLI](https://www.mongodb.com/docs/atlas/cli/current/), or the [Atlas Administration API.](https://www.mongodb.com/docs/atlas/api/atlas-admin-api.md#std-label-atlas-admin-api) [source]
- | Option | Description | More Information | | --- | --- | --- | | Create unique index | Ensure that the indexed fields do not store duplicate values. | [Unique Indexes](https://www.mongodb.com/docs/manual/core/index-unique/) | | Index name | Specify a name for the index. | [Specify an Index Name](https://www.mongodb.com/docs/manual/core/indexes/create-index/specify-index-name.md#std-label-specify-index-name) | | Create a TTL (Time to Live) index | Delete documents automatically after a specified number of seconds since the indexed field value. | [TTL Indexes](https://www.mongodb.com/docs/manua [source]
- This command is autogenerated and corresponds 1:1 with the Atlas API endpoint [https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-enablegroupmanagedslowms.](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-enablegroupmanagedslowms) [source]
- This command is autogenerated and corresponds 1:1 with the Atlas API endpoint [https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-getgroupprocessdatabase.](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-getgroupprocessdatabase) [source]
- Before MongoDB 7.0.22, 8.0.5, and 8.1.0, `planningTimeMicros` might include work that the command performs before a query retry, such as a sharding metadata refresh. Don't rely on this field alone to evaluate query-planning performance. To evaluate query-planning performance, review the total operation duration, [`keysExamined`](https://www.mongodb.com/docs/manual/reference/database-profiler.md#mongodb-data-system.profile.keysExamined), [`docsExamined`](https://www.mongodb.com/docs/manual/reference/database-profiler.md#mongodb-data-system.profile.docsExamined), and relevant sharding or lock-wa [source]
- - [atlas api queryShapeInsights getClusterQueryShape](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-queryshapeinsights-getclusterqueryshape.md#std-label-atlas-api-queryShapeInsights-getClusterQueryShape) - Returns the details for a single query shape. [source]
- - [atlas api queryShapeInsights getQueryShapeDetails](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-queryshapeinsights-getqueryshapedetails.md#std-label-atlas-api-queryShapeInsights-getQueryShapeDetails) - Returns the metadata and statistics summary for a given query shape hash. [source]
- - [atlas api queryShapeInsights listClusterQueryShapes](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-queryshapeinsights-listclusterqueryshapes.md#std-label-atlas-api-queryShapeInsights-listClusterQueryShapes) - Returns a list of query shapes for one cluster. [source]
- - [atlas api queryShapeInsights listQueryShapeSummaries](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-queryshapeinsights-listqueryshapesummaries.md#std-label-atlas-api-queryShapeInsights-listQueryShapeSummaries) - Returns a list of query shape statistics summaries for a given cluster. [source]
- - [atlas api queryShapeInsights updateClusterQueryShape](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-queryshapeinsights-updateclusterqueryshape.md#std-label-atlas-api-queryShapeInsights-updateClusterQueryShape) - Updates the rejection status of a query shape. [source]
- Since `side_b` and `side_a` are stored as [128-bit decimals](https://www.mongodb.com/docs/mongodb-shell/reference/data-types.md#std-label-shell-type-decimal), the output of [`$atan2`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/atan2.md#mongodb-expression-exp.-atan2) is a 128-bit decimal. [source]
- Notice that the date returned, `ISODate("2021-02-28T12:10:05Z")`, is the 28th and not the 31st since February has fewer days than March. [source]
- The second major dimension for querying time series data is time. Since MongoDB groups documents that have both an identical `metaField` value and close `timeField` values, this further narrows the scope of a query to a range of buckets. Recent transactions are kept in memory, so it's easy to stream data in real time. [source]
- | Name | Type | Required | Description | | --- | --- | --- | --- | | -h, --help | | false | help for namespaces | [source]
- `$dateDiff` counts the unit boundaries crossed between `startDate` and `endDate`. It does not measure elapsed duration. For example, `$dateDiff` reports a difference of one `year` between December 31, 2022 and January 1, 2023. A year boundary was crossed, even though a few hours passed between the two dates. See [Year Boundary Crossing](https://www.mongodb.com/docs/manual/reference/operator/aggregation/datediff.md#std-label-dateDiff-year-boundary-example) for a full example. [source]
- Atlas provides the following default alerts for organizations that use [service accounts.](https://www.mongodb.com/docs/atlas/api/api-authentication.md#std-label-service-accounts-overview) [source]
- - **After 24 hours:** Atlas disables the notification method and notifies the project owners. [source]
- If in DAY(S) appears next to the option you selected, specify the number of days before your service account secret expires that you want to be notified. [source]
- There are no specific instructions for creating organization alerts using the Atlas CLI. Instead, select Atlas UI from the Interface dropdown on this page. [source]
- There are no specific instructions for viewing organization alert configurations using the Atlas CLI. Instead, select Atlas UI from the Interface dropdown on this page. [source]
- There are no specific instructions for disabling an organization alert using the Atlas CLI. Instead, select Atlas UI from the Interface dropdown on this page. [source]
- There are no specific instructions for enabling organization alerts using the Atlas CLI. Instead, select Atlas UI from the Interface dropdown on this page. [source]
- There are no specific instructions for deleting an organization alert using the Atlas CLI. Instead, select Atlas UI from the Interface dropdown on this page. [source]
- You can search and pin a maximum of five namespaces to the top of the table from the Pinned Namespace dialog box or Search namespaces search box. [source]
- 1. Open the Pinned Namespaces dialog box. [source]
- - If you have no pinned namespaces, click the Pin namespaces button. [source]
- - If you have pinned namespaces, click the Manage pinned namespaces button. [source]
- The Pinned Namespaces dialog box displays. [source]
- 2. Search the namespaces. [source]
- Specify a namespace in the Enter namespaces to pin search box. You can also pin planned namespaces that don't exist yet. [source]
- Atlas displays up to five namespaces. It displays pinned namespaces (if any) and then top namespaces with the highest total latency by default. You can also manually select the namespaces to chart. [source]
- Specify a namespace in the Search namespaces search box. [source]
- You can select a maximum of five namespaces. If you have five namespaces and want to display another, you must deselect one. [source]
- - [atlas api monitoringAndLogs getDatabase](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-monitoringandlogs-getdatabase.md#std-label-atlas-api-monitoringAndLogs-getDatabase) - Returns one database running on the specified host for the specified project. [source]
- - [atlas api monitoringAndLogs getDatabaseMeasurements](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-monitoringandlogs-getdatabasemeasurements.md#std-label-atlas-api-monitoringAndLogs-getDatabaseMeasurements) - Returns the measurements of one database for the specified host for the specified project. [source]
- - [atlas api monitoringAndLogs getGroupProcess](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-monitoringandlogs-getgroupprocess.md#std-label-atlas-api-monitoringAndLogs-getGroupProcess) - Returns the processes for the specified host for the specified project. [source]
- - [atlas api monitoringAndLogs getProcessDisk](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-monitoringandlogs-getprocessdisk.md#std-label-atlas-api-monitoringAndLogs-getProcessDisk) - Returns measurement details for one disk or partition for the specified host for the specified project. [source]
- - [atlas api monitoringAndLogs getProcessDiskMeasurements](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-monitoringandlogs-getprocessdiskmeasurements.md#std-label-atlas-api-monitoringAndLogs-getProcessDiskMeasurements) - Returns the measurements of one disk or partition for the specified host for the specified project. [source]
- - [atlas api monitoringAndLogs listDatabases](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-monitoringandlogs-listdatabases.md#std-label-atlas-api-monitoringAndLogs-listDatabases) - Returns the list of databases running on the specified host for the specified project. [source]
- - [atlas api monitoringAndLogs listGroupProcesses](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-monitoringandlogs-listgroupprocesses.md#std-label-atlas-api-monitoringAndLogs-listGroupProcesses) - Returns details of all processes for the specified project. [source]
- - [atlas api monitoringAndLogs listProcessDisks](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-monitoringandlogs-listprocessdisks.md#std-label-atlas-api-monitoringAndLogs-listProcessDisks) - Returns the list of disks or partitions for the specified host for the specified project. [source]
- This command is autogenerated and corresponds 1:1 with the Atlas API endpoint [https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-getgroupalertconfigalerts.](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-getgroupalertconfigalerts) [source]
- Navigate to the [Create One Rolling Index](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-creategroupclusterindexrollingindex) section of the Atlas Admin API specification. [source]
- Using different storage devices will affect your ability to create snapshot-style backups of your data, since the files will be on different devices and volumes. [source]
- since: the time from which MongoDB gathered the statistics [source]
- accesses: { ops: Long("1"), since: ISODate("2024-05-02T15:07:21.420Z") }, [source]
- accesses: { ops: Long("1"), since: ISODate("2024-05-02T15:07:21.254Z") }, [source]
- accesses: { ops: Long("0"), since: ISODate("2024-05-02T15:07:13.274Z") }, [source]
- accesses: { ops: Long("0"), since: ISODate("2024-05-02T15:07:54.847Z") }, [source]
- - [`$text`](https://www.mongodb.com/docs/manual/reference/operator/query/text.md#mongodb-query-op.-text) operator, since `$text` in aggregation is valid only for the first stage. [source]
- [`db.createView()`](https://www.mongodb.com/docs/manual/reference/method/db.createview.md#mongodb-method-db.createView) obtains an exclusive lock on the specified collection or view for the duration of the operation. All subsequent operations on the collection must wait until [`db.createView()`](https://www.mongodb.com/docs/manual/reference/method/db.createview.md#mongodb-method-db.createView) releases the lock. [`db.createView()`](https://www.mongodb.com/docs/manual/reference/method/db.createview.md#mongodb-method-db.createView) typically holds this lock for a short time. [source]
- - Since there are only 3 documents with `scores`, `$minN` returns the minimum 3 `score` fields even though `n = 4`. [source]
- If you do not include a `keyVersion` field, Azure Key Vault attempts to decrypt Data Encryption Keys using the latest Customer Master Key. If you rotate the CMK (Customer Master Key) but do not [rewrap the Data Encryption Keys](https://www.mongodb.com/docs/manual/core/queryable-encryption/fundamentals/manage-keys.md#std-label-qe-fundamentals-manage-keys) with the new master key, attempting to decrypt an existing DEK (Data Encryption Key) fails, since the DEK (Data Encryption Key) is encrypted with the previous version of the CMK (Customer Master Key). [source]
- | Field | Required | Description | | --- | --- | --- | | email | Yes | Identifies your service account email address. | | privateKey | Yes | Identifies your service account private key in either [base64 string](https://en.wikipedia.org/wiki/Base64) or [Binary subtype 0](https://www.mongodb.com/docs/manual/reference/mongodb-extended-json/#bson.Binary) format without the prefix and suffix markers.Suppose your service account private key value is as follows: `-----BEGIN PRIVATE KEY-----\nyour-private-key\n-----END PRIVATE KEY-----\n` The value you would specify for this field is: `your-private-ke [source]
- If you don't set the duration option or the since option, this command returns data from the last 24 hours. [source]
- Query Shape Reports, which send a summary of inefficient query shapes to Project Owners by email. [source]
- Notice that the date returned, `ISODate("2020-11-30T12:10:05Z")`, is the 30th and not the 31st since November has fewer days than October. [source]
- Namespaces appear in the following format: \{database}.\{collection}. [source]
- You can also monitor collection-level [query latency](https://www.mongodb.com/docs/manual/reference/operator/aggregation/collStats/#latencystats-document) with [Namespace Insights](https://www.mongodb.com/docs/atlas/namespace-insights.md#std-label-namespace-insights) and query performance with the [Query Profiler.](https://www.mongodb.com/docs/atlas/tutorial/query-profiler.md#std-label-query-profiler) [source]
- - `0` to set the `slowms`, `sampleRate`, and `filter` for the diagnostic log; [source]
- The profiler collects data for operations that exceed the `slowms` threshold or match a specified [filter.](https://www.mongodb.com/docs/manual/reference/method/db.setprofilinglevel.md#std-label-set-profiling-level-options-filter) [source]
- - The [Query Profiler](https://www.mongodb.com/docs/atlas/tutorial/query-profiler.md#std-label-query-profiler), which describes specific inefficient queries executed on the cluster. [source]
- Atlas might not [log](https://www.mongodb.com/docs/atlas/mongodb-logs.md#std-label-mongodb-logs) the individual operations that contribute to the Query Targeting ratios due to automatically set thresholds. However, you can still use the Query Profiler and Query Targeting metrics to analyze and optimize query performance. [source]
- 2. Go to the Query Profiler tab. [source]
- Click the Query Profiler tab. [source]
- Both the Atlas Query Profiler and the database profiler can affect server performance, use up disk space, and expose query metadata around encrypted fields. Consider the performance and security implications before enabling them. [source]
- Starting in MongoDB 6.3, a message is added to the log if the time to send an operation response exceeds the slowms threshold option. [source]
- A session workflow message is added to the log if sendResponseMillis exceeds the slowms threshold option. [source]
- You can also monitor collection-level query latency with Namespace Insights and query performance with the Query Profiler. [source]
- A session workflow message is added to the log if `sendResponseMillis` exceeds the [slowms threshold option.](https://www.mongodb.com/docs/manual/reference/command/profile.md#std-label-slowms-threshold-option) [source]
- The Atlas Query Profiler supports binning operations of the same type running on the same collection around the same timestamp to support additional datapoints. [source]
- **Important: Please read the following considerations before you enable the Query Profiler.** [source]
- The Query Profiler displays approximately 100,000 sampled logs at a time. It shows all the logs if 100,000 or less logs were recorded in the selected hosts and time range. [source]
- The Query Profiler does not include bulk operations in its query sampling and analysis. Bulk write operations are excluded from the profiled queries displayed in the Query Profiler. Excluded operations include [`bulkWrite()`](https://www.mongodb.com/docs/manual/reference/method/db.collection.bulkWrite.md#mongodb-method-db.collection.bulkWrite), `updateMany` with multiple `stmtIds`, and similar multi-document operations. [source]
- Atlas enables the Query Profiler by default. [source]
- 2. Disable the Query Profiler. [source]
- The Query Profiler displays all your data from the log on the [primary](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-primary) and [secondary](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-secondary) nodes by default. [source]
- 3. Customize the Query Profiler. [source]
- Select the time period from the Time Range or Filter by Date and Time dropdowns. The Query Profiler displays data for the last 24 hours by default. [source]
- Click the All operation types dropdown to change which operations you want to profile. The Query Profiler displays all operation types by default. [source]
- The Query Profiler, which describes specific inefficient queries executed on the cluster. [source]
- Atlas might not log the individual operations that contribute to the Query Targeting ratios due to automatically set thresholds. However, you can still use the Query Profiler and Query Targeting metrics to analyze and optimize query performance. [source]
- Monitor Query Performance with the Query Profiler [source]
- The Query Profiler displays all your data from the log on the primary and secondary nodes by default. [source]
Related concepts
- Atlas Administration API — is a part of Atlas slow-query log and Performance Advisor automation
- slow query log — is a part of Atlas slow-query log and Performance Advisor automation
- automation — is a related of Atlas slow-query log and Performance Advisor automation
Children
- Atlas Admin API rate limiting for scheduled polling (frontier, viability 2.60 / 5, below research gate)
- Drop-index suggestions endpoint
Frontier under this node: Atlas Admin API rate limiting for scheduled polling (2.60)