Afrowave.AJIS.MongoDB
1.1.0
dotnet add package Afrowave.AJIS.MongoDB --version 1.1.0
NuGet\Install-Package Afrowave.AJIS.MongoDB -Version 1.1.0
<PackageReference Include="Afrowave.AJIS.MongoDB" Version="1.1.0" />
<PackageVersion Include="Afrowave.AJIS.MongoDB" Version="1.1.0" />
<PackageReference Include="Afrowave.AJIS.MongoDB" />
paket add Afrowave.AJIS.MongoDB --version 1.1.0
#r "nuget: Afrowave.AJIS.MongoDB, 1.1.0"
#:package Afrowave.AJIS.MongoDB@1.1.0
#addin nuget:?package=Afrowave.AJIS.MongoDB&version=1.1.0
#tool nuget:?package=Afrowave.AJIS.MongoDB&version=1.1.0
Afrowave.AJIS.MongoDB
MongoDB integration for the AJIS (.NET) framework. Provides BSON serializers and collection operations for seamless document storage.
Overview
The MongoDB library enables storing AJIS-serialized objects in MongoDB documents:
- BSON serializers - Custom MongoDB BSON serializers for AJIS
- Collection operations - High-level CRUD operations
- Aggregation pipeline - Full support for MongoDB aggregations
- Async streaming - Efficient operations over large datasets
- Type mapping - Full support for AJIS type mapping features
Features
- BSON serializer -
AjisBsonSerializer<T>for document serialization - Collection wrapper -
AjisMongoCollection<T>for simplified operations - Repository pattern -
AjisMongoRepository<T>for data access - Aggregation support - Pipeline operators and group operations
- Index support - MongoDB index configuration
- Bulk operations - Efficient batch insert/update/delete
- Filter support - Strongly-typed filters with AJIS properties
Installation
dotnet add package Afrowave.AJIS.MongoDB
Dependencies
| Package | Version | Description |
|---|---|---|
| Afrowave.AJIS.Core | >= 1.0.0 | Core contracts and settings |
| Afrowave.AJIS.Serialization | >= 1.0.0 | Serializer and value types |
| MongoDB.Driver | >= 3.6.0 | MongoDB .NET driver |
Library Summary
| Feature | Description |
|---|---|
| Target Framework | .NET 10.0 |
| Serialization Format | BSON (MongoDB format) |
| Key Components | AjisBsonSerializer<T>, AjisMongoCollection<T> |
| Aggregation Support | Full pipeline operators |
| Collection Operations | Full CRUD operations |
| Nullable Reference Types | Enabled |
API
See the API Reference for complete documentation.
Key Types
| Type | Description |
|---|---|
AjisBsonSerializer<T> |
BSON serializer for AJIS |
AjisMongoCollection<T> |
MongoDB collection wrapper |
AjisMongoRepository<T> |
Repository for CRUD operations |
AjisMongoExtensions |
Extension methods for registration |
Usage
Basic configuration
// Register AJIS serializers
AjisMongoExtensions.RegisterAjisSerializers();
// Repository
public class UserRepository : AjisMongoRepository<User>
{
public UserRepository(IMongoDatabase database)
: base(database, "users") { }
}
// Usage
var repository = new UserRepository(database);
// Insert document
await repository.InsertAsync(new User { Name = "John", Email = "john@example.com" });
// Find by ID
var user = await repository.GetByIdAsync(1);
// Complex queries
var activeUsers = await repository.FindAsync(u => u.IsActive && u.Age > 18);
Aggregation pipeline
var result = await repository.Aggregate()
.Match(u => u.IsActive)
.Group(u => u.Role, g => new { Role = g.Key, Count = g.Count() })
.ToListAsync();
Bulk operations
var users = Enumerable.Range(1, 1000)
.Select(i => new User { Name = $"User{i}", Age = i });
await repository.BulkInsertAsync(users);
Documentation
- API Reference - Complete API documentation
- MongoDB Integration - MongoDB documentation
- Getting Started - Quick start guide
Compatibility
- .NET 10.0+
- MongoDB.Driver 3.6+
- Nullable reference types enabled
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- Afrowave.AJIS.Core (>= 1.1.0)
- Afrowave.AJIS.Serialization (>= 1.1.0)
- MongoDB.Driver (>= 3.6.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
## v1.1.0 (2026-02-16)
### New Features
- MongoDB BSON serializers now work with new Ajis static API
- Integration with new Ajis static API from Afrowave.AJIS.Core v1.1.0
### Dependencies
- Afrowave.AJIS.Core v1.1.0
### Notes
- No breaking changes in this release