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

mongocli cloud-manager clusters indexes create

On this page

  • Syntax
  • Arguments
  • Options
  • Inherited Options
  • Examples

Create a rolling index for your MongoDB cluster.

mongocli cloud-manager clusters indexes create [indexName] [options]
Name
Type
Required
Description
indexName
string
false
Name of the index to create.
Name
Type
Required
Description
--MaxVariable
string
false
Flag that, if specified, determines which characters to ignore. This flag applies only if indexConfigs.collation.alternate is set to shifted.
--alternate
string
false
Flag that, if specified, determines whether collation should consider whitespace and punctuation as base characters during comparisons.
--backwards
false
Flag that, if set to true, strings with diacritics sort from the back to the front of the string.
--caseFirst
string
false
Flag that, if specified, determines the sort order of case differences during tertiary level comparisons.
--caseLevel
false
Flag that indicates whether the index uses case comparison. This flag applies only if the strength level is set to 1 or 2.
--collectionName
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.
--locale
string
false
Locale that the ICU defines.
--normalization
false
Flag that, if set to true, collation checks if text requires normalization and performs normalization to compare text.
--numericOrdering
false
Flag that, if set to true, indicates that collation compares numeric strings as numbers. If set to false, collation compares numeric strings as strings.
--projectId
string
false
Project ID to use. Overrides the settings in the configuration file or environment variable.
--rsName
string
true
The replica set that the index is built on.
--sparse
false
Flag that indicates whether Atlas should create a sparse index.
--strength
int
false
Level of comparison to perform.
Name
Type
Required
Description
-P, --profile
string
false
Profile to use from your configuration file.
The following example creates an index named bedrooms_1 on the listings collection of the realestate database on the replica set repl1.
The command uses the default profile.
mongocli om clusters indexes create bedrooms_1 \
--collectionName listings --db realestate --key bedrooms:1 \
--rsName repl1

Back

indexes