FxMap.MongoDb 4.1.1

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

<p align="center"> <img src="https://raw.githubusercontent.com/quyvu01/FxMap/main/FxMap.png" alt="FxMap" width="96" /> </p>

<h1 align="center">FxMap.MongoDb</h1>

<p align="center"> MongoDB data provider for FxMap — answers FxMap requests straight from your collections. </p>

<p align="center"> <a href="https://www.nuget.org/packages/FxMap.MongoDb"><img alt="NuGet" src="https://img.shields.io/nuget/v/FxMap.MongoDb.svg" /></a> <a href="https://www.nuget.org/packages/FxMap.MongoDb"><img alt="Downloads" src="https://img.shields.io/nuget/dt/FxMap.MongoDb.svg" /></a> <a href="https://github.com/quyvu01/FxMap/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/badge/license-Apache--2.0-blue.svg" /></a> </p>

<p align="center"> <a href="https://github.com/quyvu01/FxMap"><b>FxMap</b></a> · <a href="https://fxmapper.net"><b>Documentation</b></a> · <a href="https://github.com/quyvu01/TestFxMap-Demo"><b>Demo project</b></a> </p>


The owning service of an entity registers it with EntityConfigureOf<T> and hands FxMap the IMongoCollection<T> that stores it. Incoming requests (ids plus expressions) become one MongoDB query with a BSON projection per distributed key.

Installation

dotnet add package FxMap.MongoDb

All FxMap.* packages must use the same version.

Usage

public sealed class UserDistributedKey : IDistributedKey;

public class UserConfig : EntityConfigureOf<User>
{
    protected override void Configure()
    {
        Id(x => x.Id);
        DefaultProperty(x => x.Name);
        UseDistributedKey<UserDistributedKey>();
    }
}

builder.Services.AddFxMap(cfg =>
    {
        cfg.AddEntitiesFromAssemblyContaining<SomeEntityAssemblyMarker>();
        cfg.AddProfilesFromAssemblyContaining<SomeProfileAssemblyMarker>();
    })
    .AddMongoDb(cfg => cfg
        .AddCollection(database.GetCollection<User>("users"))
        .AddCollection(database.GetCollection<Order>("orders")));

Notes

  • AddCollection can be chained; register one collection per entity that FxMap should serve.
  • Expressions are evaluated against the stored documents, so they use the actual property names of the model (not an ExposedName).
  • Ids are parsed to the entity's id type through the same converters as the other providers, including strongly typed ids with an IStronglyTypeConverter<TId>. As of 2.3.5 a response is also answered under the id text that was sent. That match compares the text of the stored _id with the text of the parsed id, so an id type whose BSON text form differs from ToString() is not matched. Test your id type.
Package Description Documentation
Core
FxMap FxMap core: profiles, entity configs, the mapper and the expression language README
Data providers
FxMap.EntityFrameworkCore Answers requests from an Entity Framework Core DbContext README
FxMap.MongoDb Answers requests from MongoDB collections This document
Integrations
FxMap.HotChocolate Fills GraphQL response types through HotChocolate README
Transports
FxMap.Grpc gRPC transport README
FxMap.Nats NATS transport README
FxMap.RabbitMq RabbitMQ transport README
FxMap.Kafka Apache Kafka transport README
FxMap.Azure.ServiceBus Azure Service Bus transport (Standard / Premium tiers) README
FxMap.Aws.Sqs Amazon SQS transport README
Tooling
FxMap.Analyzers Roslyn analyzer that validates expression strings at compile time README
Product 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 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
4.1.1 69 10/6/2026
4.1.0 86 10/5/2026
4.0.0 86 10/5/2026
3.0.0 83 10/2/2026
2.3.5 86 10/2/2026
2.3.4 88 10/2/2026
2.3.3 87 10/1/2026
2.3.2 88 10/1/2026
2.3.1 114 8/21/2026
2.3.0 138 6/16/2026
2.2.2 127 6/3/2026
2.2.1 119 5/31/2026
2.2.0 124 5/26/2026
2.1.1 117 5/26/2026
2.1.0 128 5/7/2026
2.0.1 134 4/5/2026
2.0.0 126 4/5/2026
1.0.3 144 3/15/2026
1.0.2 132 3/7/2026
1.0.1 119 3/6/2026
Loading failed