MongoRepository documentation
IRepositoryManagerT, TKeyEnsureIndexes Method (IEnumerableString, Boolean, Boolean, Boolean) |
Ensures that the desired indexes exist and creates them if they don't exist.
Namespace: MongoRepository
Assembly: MongoRepository.Net45 (in MongoRepository.Net45.dll) Version: 1.6.11.0 (1.6.11.0)
Syntax
void EnsureIndexes( IEnumerable<string> keynames, bool descending, bool unique, bool sparse )
Sub EnsureIndexes ( keynames As IEnumerable(Of String), descending As Boolean, unique As Boolean, sparse As Boolean )
void EnsureIndexes( IEnumerable<String^>^ keynames, bool descending, bool unique, bool sparse )
abstract EnsureIndexes : keynames : IEnumerable<string> * descending : bool * unique : bool * sparse : bool -> unit
Parameters
- keynames
- Type: System.Collections.GenericIEnumerableString
The indexed fields. - descending
- Type: SystemBoolean
Set to true to make index descending, false for ascending. - unique
- Type: SystemBoolean
Set to true to ensure index enforces unique values. - sparse
- Type: SystemBoolean
Set to true to specify the index is sparse.
Remarks
This is a convenience method for EnsureIndexes(IMongoIndexKeys keys, IMongoIndexOptions options).
See Also