Czlovek.MongoDb 3.0.0-beta.1

This is a prerelease version of Czlovek.MongoDb.
dotnet add package Czlovek.MongoDb --version 3.0.0-beta.1
                    
NuGet\Install-Package Czlovek.MongoDb -Version 3.0.0-beta.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="Czlovek.MongoDb" Version="3.0.0-beta.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Czlovek.MongoDb" Version="3.0.0-beta.1" />
                    
Directory.Packages.props
<PackageReference Include="Czlovek.MongoDb" />
                    
Project file
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 Czlovek.MongoDb --version 3.0.0-beta.1
                    
#r "nuget: Czlovek.MongoDb, 3.0.0-beta.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 Czlovek.MongoDb@3.0.0-beta.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=Czlovek.MongoDb&version=3.0.0-beta.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Czlovek.MongoDb&version=3.0.0-beta.1&prerelease
                    
Install as a Cake Tool

MongoDb Client

A thin wrapper around the official MongoDB.Driver, resolving one or more named database connections from configuration and providing a generic repository base class.

Usage

Registration

services.AddMongoDb(configuration);

Configuration is read from the MongoDb section, keyed by connection name:

{
  "MongoDb": {
    "DefaultClient": {
      "Host": "localhost",
      "Port": 27017,
      "User": "admin",
      "Password": "",
      "DatabaseName": "my-database"
    }
  }
}

This registers IMongoDbDefaultClient for the DefaultClient connection.

Defining a repository

Documents implement IMongoDbDocument (an ObjectId Id property), and repositories derive from MongoDbRepository<T>:

public class Order : IMongoDbDocument
{
    public ObjectId Id { get; set; }
    public string CustomerName { get; set; } = string.Empty;
}

public class OrderRepository(IMongoDbDefaultClient client)
    : MongoDbRepository<Order>(client, "orders"), IOrderRepository;

MongoDbRepository<T> provides InsertAsync, InsertManyAsync, SelectAsync, AggregateAsync, UpsertAsync, UpsertManyAsync, SelectAndUpdateAsync and DeleteAsync, all accepting a CancellationToken.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
3.0.0-beta.1 43 7/19/2026
2.1.0-beta.85 69 6/16/2026
2.1.0-beta.84 60 5/7/2026
2.1.0-beta.83 58 5/7/2026
2.1.0-beta.82 111 3/20/2026
2.1.0-beta.81 76 2/21/2026
2.1.0-beta.80 78 2/21/2026
2.1.0-beta.79 77 2/13/2026
2.1.0-beta.78 88 2/11/2026
2.1.0-beta.77 75 2/11/2026
2.1.0-beta.76 74 2/10/2026
2.1.0-beta.75 82 2/10/2026
2.1.0-beta.74 82 1/28/2026
2.1.0-beta.73 205 11/6/2025
2.1.0-beta.72 175 11/6/2025
2.1.0-beta.71 186 11/4/2025
2.1.0-beta.70 181 11/4/2025
2.1.0-beta.69 185 11/4/2025
2.1.0-beta.68 191 11/4/2025
2.1.0-beta.67 190 11/2/2025
Loading failed