Rapidata.MongoDB.Migrations.AspNetCore
2.1.1
dotnet add package Rapidata.MongoDB.Migrations.AspNetCore --version 2.1.1
NuGet\Install-Package Rapidata.MongoDB.Migrations.AspNetCore -Version 2.1.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Rapidata.MongoDB.Migrations.AspNetCore" Version="2.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Rapidata.MongoDB.Migrations.AspNetCore" Version="2.1.1" />
<PackageReference Include="Rapidata.MongoDB.Migrations.AspNetCore" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Rapidata.MongoDB.Migrations.AspNetCore --version 2.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Rapidata.MongoDB.Migrations.AspNetCore, 2.1.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Rapidata.MongoDB.Migrations.AspNetCore@2.1.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Rapidata.MongoDB.Migrations.AspNetCore&version=2.1.1
#tool nuget:?package=Rapidata.MongoDB.Migrations.AspNetCore&version=2.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Rapidata.MongoDB.Migrations
A modern, thread-safe MongoDB migration engine for C#
Features
- 🔒 Thread-safe: Can be run by multiple services simultaneously
- 🔄 Guaranteed single execution for each migration
- 📚 Support for multiple database migrations
- ⚙️ Flexible configuration options
- 🚀 Easy integration with ASP.NET Core
Usage
Basic Usage
To get started, define the migrations in an assembly.
// Define a migration
public class TestMigration : IMigration
{
public DateOnly Date => new(2024, 10, 10);
public short Version => 1;
public string Name => "Test Migration";
public async Task Migrate(IMongoDatabase database, CancellationToken cancellationToken)
{
await database.CreateCollectionAsync(nameof(TestMigration), options: null, cancellationToken);
}
}
Then, register the migrations in the host and define at least one database to migrate.
// Register dependencies on the host
host.AddMongoDbMigrations(builder => builder.WithDatabase("default").WithMigrationsInAssemblyOfType<TestMigration>);
// Run the migrations
await host.MigrateMongoDb();
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- Rapidata.MongoDB.Migrations (>= 2.1.1)
-
net9.0
- Rapidata.MongoDB.Migrations (>= 2.1.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
2.1.1 | 23,183 | 3/13/2025 |
2.1.0 | 11,993 | 12/2/2024 |
2.0.0 | 149 | 11/29/2024 |
1.0.0 | 3,824 | 11/21/2024 |
0.0.16 | 123 | 11/20/2024 |
0.0.15 | 126 | 11/20/2024 |
0.0.12 | 4,448 | 10/21/2024 |
0.0.11 | 4,762 | 9/13/2024 |
0.0.10 | 120 | 9/13/2024 |
0.0.9 | 140 | 9/13/2024 |
0.0.8 | 124 | 9/13/2024 |
0.0.7 | 101 | 9/13/2024 |
0.0.6 | 108 | 9/13/2024 |
0.0.5 | 135 | 9/13/2024 |
0.0.4 | 116 | 9/13/2024 |
0.0.3 | 117 | 9/13/2024 |
0.0.2 | 97 | 9/12/2024 |
0.0.1 | 118 | 9/12/2024 |