Click or drag to resize

LiteEngine Class

A public class that take care of all engine data structure access - it´s basic implementation of a NoSql database Its isolated from complete solution - works on low level only (no linq, no poco... just BSON objects) [ThreadSafe]
Inheritance Hierarchy
SystemObject
  Internal.LiteDB.EngineLiteEngine

Namespace: Internal.LiteDB.Engine
Assembly: NeoAxis.Core (in NeoAxis.Core.dll) Version: 2026.1.1.0 (2026.1.1.0)
Syntax
C#
public class LiteEngine : ILiteEngine, IDisposable

The LiteEngine type exposes the following members.

Constructors
 NameDescription
Public methodLiteEngine Initialize LiteEngine using connection memory database
Public methodLiteEngine(EngineSettings) Initialize LiteEngine using initial engine settings
Public methodLiteEngine(String) Initialize LiteEngine using connection string using key=value; parser
Top
Methods
 NameDescription
Public methodBeginTrans Initialize a new transaction. Transaction are created "per-thread". There is only one single transaction per thread. Return true if transaction was created or false if current thread already in a transaction.
Public methodCheckpoint Run checkpoint command to copy log file into data file
Public methodCommit Persist all dirty pages into LOG file
Public methodDelete Implements delete based on IDs enumerable
Public methodDeleteMany Implements delete based on filter expression
Public methodDisposeReleases all resources used by the LiteEngine
Protected methodDispose(Boolean)Releases the unmanaged resources used by the LiteEngine and optionally releases the managed resources
Public methodDropCollection Drop collection including all documents, indexes and extended pages (do not support transactions)
Public methodDropIndex Drop an index from a collection
Public methodEnsureIndex Create a new index (or do nothing if already exists) to a collection/field
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodGetCollectionNames Returns all collection inside datafile
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodInsert Insert all documents in collection. If document has no _id, use AutoId generation.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodPragma(String) Get engine internal pragma value
Public methodPragma(String, BsonValue) Set engine pragma new value (some pragmas will be affected only after realod)
Public methodQuery Run query over collection using a query definition. Returns a new IBsonDataReader that run and return first document result (open transaction)
Public methodRebuild Implement a full rebuild database. A backup copy will be created with -backup extention. All data will be readed and re created in another database
Public methodRebuild(RebuildOptions) Implement a full rebuild database. Engine will be closed and re-created in another instance. A backup copy will be created with -backup extention. All data will be readed and re created in another database After run, will re-open database
Public methodRenameCollection Rename a collection (do not support transactions)
Public methodRollback Do rollback to current transaction. Clear dirty pages in memory and return new pages to main empty linked-list
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Public methodUpdate Implement update command to a document inside a collection. Return number of documents updated
Public methodUpdateMany Update documents using transform expression (must return a scalar/document value) using predicate as filter
Public methodStatic memberUpgrade Upgrade old version of LiteDB into new LiteDB file structure. Returns true if database was completed converted If database already in current version just return false
Obsolete
Public methodUpsert Implement upsert command to documents in a collection. Calls update on all documents, then any documents not updated are then attempted to insert. This will have the side effect of throwing if duplicate items are attempted to be inserted.
Top
Extension Methods
 NameDescription
Public Extension MethodMethodInvoke Calls the object method by name.
(Defined by ObjectEx)
Public Extension MethodPropertyGet Gets the value of the object property by name.
(Defined by ObjectEx)
Public Extension MethodPropertyGetT Gets the value of the object property by name.
(Defined by ObjectEx)
Public Extension MethodPropertySet Sets the value of the object property by name.
(Defined by ObjectEx)
Top
See Also