OPTIONS

db.collection.createIndex()

Definition

db.collection.createIndex(keys, options)

Deprecated since version 1.8.

Creates indexes on collections.

Parameter Type Description
keys document For each field to index, a key-value pair with the field and the index order: 1 for ascending or -1 for descending.
options document Optional. One or more key-value pairs that specify index options. For a list of options, see db.collection.ensureIndex().