Click or drag to resize

ILiteCollectionTEnsureIndexK(ExpressionFuncT, K, Boolean) Method

Create a new permanent index in all documents inside this collections if index not exists already.

Namespace: Internal.LiteDB
Assembly: NeoAxis.Core (in NeoAxis.Core.dll) Version: 2026.1.1.0 (2026.1.1.0)
Syntax
C#
bool EnsureIndex<K>(
	Expression<Func<T, K>> keySelector,
	bool unique = false
)

Parameters

keySelector  ExpressionFuncT, K
LinqExpression to be converted into BsonExpression to be indexed
unique  Boolean  (Optional)
Create a unique keys index?

Type Parameters

K

Return Value

Boolean
See Also