XpoNoSql.MongoDatabase 0.2.0

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

XpoNoSql.MongoDatabase

A custom MongoDB-backed XPO DataStore for DevExpress XPO
(IDataStore, SimpleDataLayer, ThreadSafeDataLayer compatible).

This provider translates XPO SelectStatements, ModificationStatements, CriteriaOperator trees, joins, aggregates, and subqueries into MongoDB aggregation pipelines — allowing XPO to run seamlessly on MongoDB.


✨ Features

  • Full XPO SelectStatement → MongoDB $match, $lookup, $group, $project, $sort
  • CriteriaOperator support:
    • Binary operators, group operators, function operators
    • LIKE with SQL-style % / _ semantics (converted to regex)
    • StartsWith / EndsWith / Contains
    • Case sensitivity respected via XpoDefault.DefaultCaseSensitive
  • Joins:
    • Inner joins
    • Left Outer joins
    • Self-joins
  • Aggregates:
    • Count, Sum, Avg, Min, Max, Exists
  • Subqueries (inside WHERE / HAVING / projections)
  • Materialization to SelectStatementResult and XPView
  • CRUD:
    • Insert / Update / Delete with optimistic locking
    • Identity generation via atomic counter collection

🚀 Quick Start

Minimal setup to run XPO against MongoDB:

using DevExpress.Xpo;
using XpoNoSql.MongoDatabase;

// Register the provider so XPO can resolve the "MongoDB" connection string scheme.
MongoConnectionProvider.Register();

// Build the MongoDB XPO connection string.
string connectionString =
    MongoConnectionProvider.GetConnectionString(
        connectionUri: "mongodb://localhost:27017",
        databaseName: "XpoMongoDemo");

// Create the XPO IDataStore using the built-in DevExpress factory.
IDataStore provider =
    XpoDefault.GetConnectionProvider(connectionString, AutoCreateOption.DatabaseAndSchema);

// Assign the application's data layer.
XpoDefault.DataLayer = new SimpleDataLayer(provider);

// Use XPO as usual.
using (var uow = new UnitOfWork())
{
    var customer = new TestCustomer(uow) { Name = "Alice" };
    uow.CommitChanges();
}

No extra plumbing required. All XPO operations — queries, joins, grouping, aggregates, and CRUD — automatically run through your MongoDB-backed provider.

🚧 Current Limits / Work in Progress

No standalone transaction support (Mongo does not require explicit Begin/Commit in this provider) Some advanced XPO functions still unimplemented Update/Delete with subqueries may not be fully supported Multi-database support planned Pull requests welcome 🚀

📦 Installation

clone the repository:

git clone https://github.com/gbonaros/XpoNoSql.MongoDatabase.git

or install from NuGet

dotnet add package XpoNoSql.MongoDatabase
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 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 was computed.  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
0.2.0 208 11/28/2025
0.1.1 212 11/27/2025
0.1.0 202 11/27/2025