Namespace eQuantic.Core.Data.MongoDb.Migration
Classes
- MongoMigrationExecutionContext
The MongoDB execution context handed to a Run(Func<IMigrationExecutionContext, CancellationToken, Task>) escape hatch: it exposes the target MongoDB.Driver.IMongoDatabase so a migration can do anything the driver allows when the fluent operations are not enough.
- MongoMigrationExecutionContextExtensions
Convenience access to the MongoDB handle from the provider-agnostic IMigrationExecutionContext.
- MongoMigrationExecutor
Applies provider-agnostic MigrationOperations to MongoDB through the driver: it creates collections and indexes, converts and renames fields across existing documents, runs data updates and hands the raw database to escape-hatch steps. Typed member selectors are resolved to their stored BSON element names (honouring
[BsonElement]/ class maps), so a migration never spells a field as a string.
- MongoMigrationHistory
Tracks applied migrations in a dedicated MongoDB collection (
_migrationsby default), keyed by the migration's stable Id. The collection makes migration state visible and queryable like any other data.
- MongoMigrationRunner
Discovers the Migration types marked with MigrationAttribute across the supplied assemblies, orders them by timestamp, skips the ones already recorded in the IMigrationHistory, and applies the rest in order through the IMigrationExecutor — recording each as it succeeds. Safe to call on every startup.