Get Index Removal Suggestions
On this page
- OAuth 2.0 authentication for programmatic access to Cloud Manager is available as a Preview feature.
- The feature and the corresponding documentation might change at any time during the Preview period. To use OAuth 2.0 authentication, create a service account to use in your requests to the Cloud Manager Public API.
Retrieves index removal suggestions as determined by the Performance Advisor.
Base URL: https://cloud.mongodb.com/api/public/v1.0
Resource
GET /groups/{PROJECT-ID}/performanceAdvisor/dropIndexSuggestions
Request Path Parameters
Parameter | Type | Description |
---|---|---|
PROJECT-ID | string | (Required) Unique identifier of the project that owns this MongoDB deployment. Groups and projects are synonymous terms. Your group ID is the same as your project ID. |
Request Query Parameters
Either clusterId
or hostId
is required.
Parameter | Type | Description |
---|---|---|
pretty | boolean | Indicates whether the response body should be in a prettyprint format. |
envelope | boolean | Indicates whether or not to wrap the response in an envelope. |
clusterId | string | Unique identifier of a replica set or sharded cluster. Set this parameter
to |
hostId | string | Unique identifier of the standalone instance for which you want index removal suggestions.
Required if |
Request Body Parameters
This endpoint doesn't use HTTP request body parameters.
Response
Name | Type | Description |
---|---|---|
| array of documents | Information about unused indexes considered candidates for removal. |
| array of documents | Information about hidden indexes that are candidates for removal. |
| array of documents | Information about redundant indexes that might overlap with existing ones and are considered for removal. |
Example Request
curl --user '{PUBLIC-KEY}:{PRIVATE-KEY}' --digest \ --header 'Accept: application/json' \ --include \ --request GET 'https://cloud.mongodb.com/api/public/v1.0/groups/{PROJECT-ID}/performanceAdvisor/dropIndexSuggestions?clusterId={clusterId}&pretty=true'
Example Response
{ "hiddenIndexes": [ { "shardIds": ["shard-0"], "accessCount": 0, "index": [ { "_fts": "text" }, { "_ftsx": 1 } ], "name": "product_description_reviews_text", "namespace": "inventory.products", "since": "2024-10-02T18:02:22Z", "sizeBytes": 4096 }, { "shardIds": ["shard-0"], "accessCount": 0, "index": [ { "unseenFeature": 1 } ], "name": "unseenFeature_1", "namespace": "inventory.products", "since": "2024-10-02T18:02:22Z", "sizeBytes": 4096 } ], "redundantIndexes": [ { "shardIds": ["shard-0"], "accessCount": 0, "index": [ { "category": 1 } ], "name": "category_1", "namespace": "inventory.products", "relatedIndexes": [ { "accessCount": 1, "index": [ { "category": 1 }, { "price": -1 } ], "name": "category_1_price_-1", "namespace": "inventory.products", "since": "2024-10-02T18:02:22Z", "sizeBytes": 4096 } ], "since": "2024-10-02T18:02:22Z", "sizeBytes": 4096 } ], "unusedIndexes": [] }