mongocli atlas clusters indexes create
On this page
mongocli atlas
commands are now deprecated because there's a new, dedicated CLI available for Atlas users. Migrate to the Atlas CLI to enjoy the same capabilities and the latest features. You can use mongocli atlas
commands until April 30, 2023.Create a rolling index for your MongoDB cluster.
Syntax
mongocli atlas clusters indexes create [indexName] [options]
Arguments
Name | Type | Required | Description |
---|---|---|---|
indexName | string | false | Name of the index. |
Options
Name | Type | Required | Description |
---|---|---|---|
--clusterName | string | true | Name of the cluster. |
--collection | string | true | Collection name. |
--db | string | true | Database name. |
-h, --help | false | help for create | |
--key | strings | true | Field to be indexed and the type of index in the following format: field:type. |
--projectId | string | false | Project ID to use. Overrides the settings in the configuration file or environment variable. |
--sparse | false | Flag that indicates whether Atlas should create a sparse index. |
Inherited Options
Name | Type | Required | Description |
---|---|---|---|
-P, --profile | string | false | Profile to use from your configuration file. |