Rammi.MongoTypeRepository
10.1.1
dotnet add package Rammi.MongoTypeRepository --version 10.1.1
NuGet\Install-Package Rammi.MongoTypeRepository -Version 10.1.1
<PackageReference Include="Rammi.MongoTypeRepository" Version="10.1.1" />
<PackageVersion Include="Rammi.MongoTypeRepository" Version="10.1.1" />
<PackageReference Include="Rammi.MongoTypeRepository" />
paket add Rammi.MongoTypeRepository --version 10.1.1
#r "nuget: Rammi.MongoTypeRepository, 10.1.1"
#:package Rammi.MongoTypeRepository@10.1.1
#addin nuget:?package=Rammi.MongoTypeRepository&version=10.1.1
#tool nuget:?package=Rammi.MongoTypeRepository&version=10.1.1
Rammi.MongoTypeRepository
A strongly typed repository library for MongoDB and Azure Cosmos DB, providing full async support with built-in connection throttling to prevent connection pool exhaustion.
Features
- ✅ Strongly Typed: Provides strong types and repository access for MongoDB and Azure Cosmos DB
- ✅ Full Async Support: All operations support async/await patterns
- ✅ Connection Throttling: Built-in throttling prevents
MongoWaitQueueFullExceptionby limiting concurrent operations - ✅ Type Safety: Strong typing eliminates runtime errors from weak-typed MongoDB access
- ✅ Easy to Use: Simple repository pattern implementation
Installation
Install via NuGet Package Manager:
dotnet add package Rammi.MongoTypeRepository
Or via Package Manager Console:
Install-Package Rammi.MongoTypeRepository
Quick Start
// Define your data model
public class Book : IMongoItem
{
public ObjectId Id { get; set; }
public string Title { get; set; }
public string Author { get; set; }
}
// Create your repository
public class BooksRepository : TypeRepositoryBase<Book>
{
public BooksRepository(IMongoDatabase database) : base(database, "books") { }
}
// Use it
var repository = new BooksRepository(mongoDatabase);
var books = await repository.GetAllAsync();
Why Use This Library?
MongoDB and Azure Cosmos DB are weakly typed, which can lead to runtime errors. This library provides:
- Type Safety: Catch errors at compile time instead of runtime
- Connection Management: Prevents connection pool exhaustion with automatic throttling
- Clean Code: Repository pattern keeps your code organized and testable
Documentation
For complete documentation, examples, and source code, visit:
- GitHub: https://github.com/rammicz/MongoRepo
- Author: Jiri Hernik
License
This project is licensed under the MIT License.
Author
Jiri Hernik
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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 was computed. 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 is compatible. 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. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| .NET Framework | net472 is compatible. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.7.2
- MongoDB.Driver (>= 3.9.0)
-
.NETStandard 2.1
- MongoDB.Driver (>= 3.9.0)
-
net10.0
- MongoDB.Driver (>= 3.9.0)
-
net8.0
- MongoDB.Driver (>= 3.9.0)
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 |
|---|---|---|
| 10.1.1 | 157 | 6/18/2026 |
| 10.1.0 | 122 | 6/12/2026 |
| 10.0.11 | 118 | 6/10/2026 |
| 10.0.10 | 266 | 4/28/2026 |
| 10.0.9 | 346 | 3/6/2026 |
| 10.0.8 | 147 | 2/22/2026 |
| 10.0.7 | 776 | 12/3/2025 |
| 10.0.6 | 700 | 12/3/2025 |
| 10.0.5 | 709 | 12/3/2025 |
| 10.0.4 | 705 | 12/3/2025 |
| 10.0.3 | 461 | 11/18/2025 |
| 10.0.2 | 445 | 11/18/2025 |
| 10.0.1 | 445 | 11/18/2025 |
| 6.0.0 | 483 | 3/9/2023 |
| 1.3.2 | 1,096 | 2/7/2020 |
| 1.3.1 | 912 | 1/30/2020 |
| 1.3.0 | 901 | 1/30/2020 |
| 1.2.1 | 1,499 | 8/7/2018 |
| 1.2.0 | 1,368 | 10/17/2017 |
| 1.2.0-alpha | 1,183 | 8/8/2017 |
10.1.1
- Security: bumped MongoDB.Driver/MongoDB.Bson 3.5.2 -> 3.9.0 to clear transitive advisories (Snappier NU1903 high, SharpCompress NU1902 moderate). No API changes.
10.1.0
- Throttling fixed: async operations are now actually limited by the configured concurrency cap (previously operations started before the semaphore wait), and faulted operations no longer leak permits.
- CancellationToken support: every async repository method accepts an optional trailing CancellationToken, honored while queued on the throttle and forwarded to the driver. Source-compatible; recompile required (binary-breaking).
- Batch Save/Update(IEnumerable) now issue a single BulkWrite instead of one ReplaceOne round-trip per item.
- GetPagedResultsAsync pages server-side (Skip/Limit) instead of transferring all preceding pages.
- Paging filters (Contains/StartsWith/EndsWith) escape user input - fixes regex injection/ReDoS and literal matching of metacharacters.
- New ObjectIds use the driver's UTC timestamp convention.