![]() |
VOOZH | about |
dotnet add package Tharga.MongoDB --version 2.11.0
NuGet\Install-Package Tharga.MongoDB -Version 2.11.0
<PackageReference Include="Tharga.MongoDB" Version="2.11.0" />
<PackageVersion Include="Tharga.MongoDB" Version="2.11.0" />Directory.Packages.props
<PackageReference Include="Tharga.MongoDB" />Project file
paket add Tharga.MongoDB --version 2.11.0
#r "nuget: Tharga.MongoDB, 2.11.0"
#:package Tharga.MongoDB@2.11.0
#addin nuget:?package=Tharga.MongoDB&version=2.11.0Install as a Cake Addin
#tool nuget:?package=Tharga.MongoDB&version=2.11.0Install as a Cake Tool
A MongoDB repository toolkit for .NET 8 / 9 / 10. Adds dynamic database/collection naming, automatic index assurance, document-level locking with commit-on-success semantics, multi-document transactions, keyset pagination, and built-in monitoring of every call (latency, slow queries, cache stats) on top of the official MongoDB.Driver.
dotnet add package Tharga.MongoDB
builder.AddMongoDB();
Configure connection strings in appsettings.json:
"ConnectionStrings": {
"Default": "mongodb://localhost:27017/MyApp{Environment}{Part}"
}
Define an entity and a repository collection — both get auto-registered into DI:
public record Order : EntityBase<ObjectId>
{
public string CustomerName { get; init; }
public DateTime CreatedAt { get; init; }
}
public class OrderCollection : DiskRepositoryCollectionBase<Order, ObjectId>
{
public OrderCollection(IMongoDbServiceFactory factory) : base(factory) { }
public override string CollectionName => "orders";
}
Inject IRepositoryCollection<Order, ObjectId> (or your concrete collection) wherever you need it.
Disk and Lockable collection bases. Lockable adds per-document optimistic locks with commit/release/error workflows so you can hand a document to a worker, let it crash, and have the lock auto-recover.DatabaseContext — multi-tenant URLs like mongodb://.../{Environment}{Part} resolve at call time, not at startup.ByName, BySchema, DropCreate).WithTransactionAsync — session-aware writes on both Disk and Lockable; lockable leases support transactional commit so the document update and your business writes land atomically.GetPageAsync / GetPageProjectionAsync with opaque CursorToken. O(log N) per page regardless of depth, no skip penalty. CursorPager<TEntity, TKey> adapter for grids that emit (skip, pageSize).IDatabaseMonitor for live dashboards. Slow-query detection, queue metrics, cache stats, and per-collection status.ResultLimit config.Tharga.MongoDB.Blazor for the admin UI, Tharga.MongoDB.Mcp for MCP/AI integration, Tharga.MongoDB.Monitor.Client + .Server for centralised monitoring across multiple agents.Full docs, configuration reference, and worked examples for each feature: github.com/Tharga/MongoDB.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 5 NuGet packages that depend on Tharga.MongoDB:
| Package | Downloads |
|---|---|
|
Tharga.MongoDB.Blazor
Drop-in Blazor admin UI for Tharga.MongoDB — Razor components that render the live monitoring data (collections, calls, indexes, queue metrics, connected clients) on any admin page. |
|
|
Tharga.Team.Service
Server-side API-key authentication, authorization enforcement, controller registration, OpenAPI/Swagger setup, and audit logging for ASP.NET Core projects. |
|
|
Tharga.Team.MongoDB
MontoDB Team features for Tharga Blazor. |
|
|
Tharga.Cache.MongoDB
MongoDB cache features. |
|
|
Tharga.MongoDB.Monitor.Client
Forwards MongoDB monitoring data to a central server via Tharga.Communication. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 2.11.0 | 215 | 6/11/2026 | |
| 2.10.14 | 182 | 6/6/2026 | |
| 2.10.13 | 187 | 5/31/2026 | |
| 2.10.12 | 903 | 5/18/2026 | |
| 2.10.11 | 181 | 5/12/2026 | |
| 2.10.10 | 497 | 5/10/2026 | |
| 2.10.9 | 280 | 5/5/2026 | |
| 2.10.8 | 173 | 5/5/2026 | 2.10.8 is deprecated because it has critical bugs. |
| 2.10.7 | 182 | 5/5/2026 | 2.10.7 is deprecated because it has critical bugs. |
| 2.10.6 | 189 | 5/3/2026 | |
| 2.10.5 | 356 | 4/29/2026 | |
| 2.10.4 | 297 | 4/20/2026 | |
| 2.10.3 | 326 | 4/16/2026 | |
| 2.10.2 | 244 | 4/8/2026 | |
| 2.10.1 | 371 | 4/5/2026 | |
| 2.10.0 | 339 | 4/3/2026 | |
| 2.9.1 | 205 | 3/28/2026 | |
| 2.9.0 | 200 | 3/25/2026 | |
| 2.8.2 | 121 | 3/24/2026 |