OPTIONS
翻译或纠错本页面

db.collection.createIndex()

说明

db.collection.createIndex(keys, options)

1.8 版后已移除.

在集合中创建索引

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().