Method CreateIndex
CreateIndex(IMongoIndexKeys, IMongoIndexOptions)
Creates an index for this collection.
public virtual WriteConcernResult CreateIndex(IMongoIndexKeys keys, IMongoIndexOptions options)
Parameters
keys
IMongoIndexKeysThe indexed fields (usually an IndexKeysDocument or constructed using the IndexKeys builder).
options
IMongoIndexOptionsThe index options(usually an IndexOptionsDocument or created using the IndexOption builder).
Returns
- WriteConcernResult
A WriteConcernResult.
CreateIndex(IMongoIndexKeys)
Creates an index for this collection.
public virtual WriteConcernResult CreateIndex(IMongoIndexKeys keys)
Parameters
keys
IMongoIndexKeysThe indexed fields (usually an IndexKeysDocument or constructed using the IndexKeys builder).
Returns
- WriteConcernResult
A WriteConcernResult.
CreateIndex(params string[])
Creates an index for this collection.
public virtual WriteConcernResult CreateIndex(params string[] keyNames)
Parameters
keyNames
string[]The names of the indexed fields.
Returns
- WriteConcernResult
A WriteConcernResult.