Function MongoCollection.ensureIndex
Creates or updates an index.
void ensureIndex
(
scope const(std .typecons .Tuple!(string,int))[] field_orders,
IndexFlags flags = cast(IndexFlags)0,
core .time .Duration expire_time = dur(0L)
) @safe;
deprecated void ensureIndex
(
int[string] field_orders,
IndexFlags flags = cast(IndexFlags)0,
ulong expireAfterSeconds = 0LU
) @safe;
Note that the overload taking an associative array of field orders will be removed. Since the order of fields matters, it is only suitable for single-field indices.