MongoRepositoryManager(T, TKey).EnsureIndexes Method (IEnumerable(String), Boolean, Boolean, Boolean)

MongoRepository

MongoRepositoryManagerT, 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
public virtual void EnsureIndexes(
	IEnumerable<string> keynames,
	bool descending,
	bool unique,
	bool sparse
)
Public Overridable Sub EnsureIndexes ( 
	keynames As IEnumerable(Of String),
	descending As Boolean,
	unique As Boolean,
	sparse As Boolean
)
public:
virtual void EnsureIndexes(
	IEnumerable<String^>^ keynames, 
	bool descending, 
	bool unique, 
	bool sparse
)
abstract EnsureIndexes : 
        keynames : IEnumerable<string> * 
        descending : bool * 
        unique : bool * 
        sparse : bool -> unit 
override 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.

Implements

IRepositoryManagerT, TKeyEnsureIndexes(IEnumerableString, Boolean, Boolean, Boolean)
Remarks
This is a convenience method for EnsureIndexes(IMongoIndexKeys keys, IMongoIndexOptions options).
See Also