ILiteCollectionTEnsureIndex(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.LiteDBAssembly: NeoAxis.Core (in NeoAxis.Core.dll) Version: 2026.1.1.0 (2026.1.1.0)
Syntaxbool EnsureIndex(
BsonExpression expression,
bool unique = false
)
Parameters
- expression BsonExpression
- Document field/expression
- unique Boolean (Optional)
- If is a unique index
Return Value
Boolean
See Also