26.51. Class IndexHelper

Namespace: ArmoniK.Core.Adapters.MongoDB.Table.DataModel
Assembly: ArmoniK.Core.Adapters.MongoDB.dll

Helpers to created indexes for MongoDB

public class IndexHelper

26.51.1. Inheritance

objectIndexHelper

26.51.2. Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

26.51.3. Methods

26.51.3.1. CreateAscendingIndex<T>(Expression<Func<T, object?>>, bool, TimeSpan?)

Creates an ascending index model from expression

public static CreateIndexModel<T> CreateAscendingIndex<T>(Expression<Func<T, object?>> expr, bool unique = false, TimeSpan? expireAfter = null)

26.51.3.1.1. Parameters

expr Expression<Func<T, object?>>

Expression to select the field for the index

unique bool

Unicity constraint, default to false

expireAfter TimeSpan?

Setup document should expire

26.51.3.1.2. Returns

CreateIndexModel<T>

The ascending index model

26.51.3.1.3. Type Parameters

T

Type stored in database

26.51.3.2. CreateCombinedIndex<T>(Expression<Func<T, object?>>, Expression<Func<T, object?>>, bool)

Creates a combined index model from expression

public static CreateIndexModel<T> CreateCombinedIndex<T>(Expression<Func<T, object?>> first, Expression<Func<T, object?>> second, bool unique = false)

26.51.3.2.1. Parameters

first Expression<Func<T, object?>>

Expression to select the field for the first index

second Expression<Func<T, object?>>

Expression to select the field for the second index

unique bool

Unicity constraint, default to false

26.51.3.2.2. Returns

CreateIndexModel<T>

The combined index model

26.51.3.2.3. Type Parameters

T

Type stored in database

26.51.3.3. CreateHashedOrAscendingIndex<T>(Expression<Func<T, object?>>, bool)

Creates an hashed index model from expression

public static CreateIndexModel<T> CreateHashedOrAscendingIndex<T>(Expression<Func<T, object?>> expr, bool useHashed)

26.51.3.3.1. Parameters

expr Expression<Func<T, object?>>

Expression to select the field for the index

useHashed bool

Whether to use Hashed indexes

26.51.3.3.2. Returns

CreateIndexModel<T>

The hashed index model

26.51.3.3.3. Type Parameters

T

Type stored in database