Click or drag to resize

LiteCollectionTEnsureIndex(String, BsonExpression, Boolean) Method

Create a new permanent index in all documents inside this collections if index not exists already. Returns true if index was created or false if already exits

Namespace: Internal.LiteDB
Assembly: NeoAxis.Core (in NeoAxis.Core.dll) Version: 2026.1.1.0 (2026.1.1.0)
Syntax
C#
public bool EnsureIndex(
	string name,
	BsonExpression expression,
	bool unique = false
)

Parameters

name  String
Index name - unique name for this collection
expression  BsonExpression
Create a custom expression function to be indexed
unique  Boolean  (Optional)
If is a unique index

Return Value

Boolean

Implements

ILiteCollectionTEnsureIndex(String, BsonExpression, Boolean)
See Also