Key features and compatibility

Compatibility

  • Support for MongoDB 3.6 and later
  • Windows only (x86 and x64); Linux and macOS support is planned

Platforms

  • .NET 5.0-11.0
  • .NET Core 2.0-3.1
  • .NET Framework 4.5.1-4.8
  • .NET Standard 2.0
  • ASP.NET Core
  • Blazor Server

.NET languages

  • C#
  • VB.NET
  • F#

ORM support

  • Entity Framework Core 3.1, 8-11
  • Dapper 1.x, 2.x
  • NHibernate 1.x-5.x
  • Entity Developer, Devart's visual ORM designer

Entity Framework Core features

  • Full CRUD support
  • Database-First: reverse engineering of MongoDB collections to a model
  • Code-First, including migrations
  • EnsureCreated and EnsureDeleted methods
  • Owned types and complex properties mapped to embedded documents
  • Support for MongoDB transactions

Entity Framework Core limitations

  • Migrations cannot change, rename, or delete columns
  • Migrations cannot change primary keys and constraints
  • Migrations cannot rename tables and indexes
  • Sequences are not supported

Security standards

  • Authentication with a user name and password
  • Separate authentication database
  • SSL/TLS encryption
  • Server certificate validation through the Windows certificate store and client certificates

Performance

  • Connection pooling that reuses open connections
  • Pooling control through the connection string
  • Automatic retrieval of query results in batches
  • Bulk data insertion with the MongoDBLoader component; with Sql Engine=false, rows are sent in batches (BatchSize, 1,000 by default)
  • Asynchronous execution with the OpenAsync, ExecuteReaderAsync, ExecuteNonQueryAsync, and ExecuteScalarAsync methods
  • Asynchronous execution with the BeginExecuteReader/EndExecuteReader methods

IDE integration

Visual Studio

Microsoft Visual Studio 2017-2026

  • MongoDB Database data source in the Add Connection dialog box
  • Design-time components in the Toolbox: MongoDBConnection, MongoDBCommand, MongoDBDataAdapter, MongoDBCommandBuilder, MongoDBDataTable, MongoDBDataSet, MongoDBDump, MongoDBLoader, MongoDBMonitor, and MongoDBScript
  • Design-time editors for the connection, command, command builder, data adapter, DataSet, DataTable, dump, loader, and monitor components
  • DataSet Generator

Without design-time integration

  • Visual Studio Code
  • JetBrains Rider

ADO.NET architecture

  • Standard ADO.NET classes: connection, command, data reader, data adapter, parameters, and transactions
  • Automatic generation of data adapter commands with MongoDBCommandBuilder
  • Connection string builder
  • Provider factory support
  • Metadata retrieval with the GetSchema method: tables, columns, indexes, primary and unique keys, and databases
  • Transactions with snapshot isolation
  • MongoDBDataTable and MongoDBDataSet components
  • MongoDBScript and MongoDBDump components
  • MongoDBException with the server error code and message

NuGet availability

dotnet add package Devart.Data.MongoDB
dotnet add package Devart.Data.MongoDB.EFCore
  • Package versions without a suffix (X.Y.Z) target Entity Framework Core 3.1
  • Package versions ending in .8, .9, .10, and .11 target Entity Framework Core 8, 9, 10, and 11

MongoDB technology support

  • SQL queries to MongoDB collections, processed by the built-in SQL engine
  • SELECT with JOIN and GROUP BY, INSERT, UPDATE, and DELETE statements
  • DDL statements: CREATE TABLE with columns and a schema validator, DROP TABLE, CREATE INDEX, CREATE UNIQUE INDEX, and DROP INDEX
  • Native MongoDB commands in JSON with the Sql Engine option turned off
  • Nested fields of embedded documents and arrays as separate columns, or whole documents and arrays as JSON strings with the Complex As String option
  • Decimal128 values without loss of precision, with optional mapping to Decimal or Double
  • UUID values as Guid and configurable DateTimeOffset storage
  • Database set in the connection string
  • Connections with mongodb:// and mongodb+srv:// (DNS seed list) connection strings, to replica sets and additional servers
  • Transactions on replica sets and sharded clusters with BeginTransaction and TransactionScope
  • Schema validation for collections
  • Transactions option for standalone servers without transaction support: IfSupported runs commands without atomicity, Required returns an error
  • Bulk data insertion with the MongoDBLoader component
  • Command tracing with the MongoDBMonitor component and the dbMonitor utility