Docs Menu

Docs HomeMongoDB Command Line Interface

mongocli ops-manager clusters indexes create

On this page

  • Syntax
  • Arguments
  • Options
  • Inherited Options
  • Examples

Create a rolling index for your MongoDB cluster.

Command Syntax
mongocli ops-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 enables index case comparison. This flag applies only if the strength level is set to 1 or 2.
--collectionName
string
true
Name of the collection.
--db
string
true
Name of the database.
-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
Hexadecimal string that identifies the project to use. This option 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 creates a sparse index. To learn more about sparse indexes, see https://www.mongodb.com/docs/manual/core/index-sparse/
--strength
int
false
Level of comparison to perform.
Name
Type
Required
Description
-P, --profile
string
false
# Create 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
←  mongocli ops-manager clusters indexesmongocli ops-manager clusters list →
Share Feedback
© 2023 MongoDB, Inc.

About

  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2023 MongoDB, Inc.