MongoDB.Driver.Core
2.30.0
Prefix Reserved
dotnet add package MongoDB.Driver.Core --version 2.30.0
NuGet\Install-Package MongoDB.Driver.Core -Version 2.30.0
<PackageReference Include="MongoDB.Driver.Core" Version="2.30.0" />
<PackageVersion Include="MongoDB.Driver.Core" Version="2.30.0" />
<PackageReference Include="MongoDB.Driver.Core" />
paket add MongoDB.Driver.Core --version 2.30.0
#r "nuget: MongoDB.Driver.Core, 2.30.0"
#addin nuget:?package=MongoDB.Driver.Core&version=2.30.0
#tool nuget:?package=MongoDB.Driver.Core&version=2.30.0
MongoDB C# Driver
You can get the latest stable release from the official Nuget.org feed or from our github releases page.
Getting Started
Untyped Documents
using MongoDB.Bson;
using MongoDB.Driver;
var client = new MongoClient("mongodb://localhost:27017");
var database = client.GetDatabase("foo");
var collection = database.GetCollection<BsonDocument>("bar");
await collection.InsertOneAsync(new BsonDocument("Name", "Jack"));
var list = await collection.Find(new BsonDocument("Name", "Jack"))
.ToListAsync();
foreach(var document in list)
{
Console.WriteLine(document["Name"]);
}
Typed Documents
using MongoDB.Bson;
using MongoDB.Driver;
public class Person
{
public ObjectId Id { get; set; }
public string Name { get; set; }
}
var client = new MongoClient("mongodb://localhost:27017");
var database = client.GetDatabase("foo");
var collection = database.GetCollection<Person>("bar");
await collection.InsertOneAsync(new Person { Name = "Jack" });
var list = await collection.Find(x => x.Name == "Jack")
.ToListAsync();
foreach(var person in list)
{
Console.WriteLine(person.Name);
}
Documentation
Questions/Bug Reports
If you’ve identified a security vulnerability in a driver or any other MongoDB project, please report it according to the instructions here.
Contributing
Please see our guidelines for contributing to the driver.
Thank you to everyone who has contributed to this project.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.7.2
- AWSSDK.SecurityToken (>= 3.7.100.14)
- DnsClient (>= 1.6.1)
- Microsoft.Extensions.Logging.Abstractions (>= 2.0.0)
- MongoDB.Bson (>= 2.30.0)
- MongoDB.Libmongocrypt (>= 1.12.0)
- SharpCompress (>= 0.30.1)
- Snappier (>= 1.0.0)
- System.Buffers (>= 4.5.1)
- System.Net.Http (>= 4.3.4)
- System.Runtime.InteropServices.RuntimeInformation (>= 4.3.0)
- ZstdSharp.Port (>= 0.7.3)
-
.NETStandard 2.0
- AWSSDK.SecurityToken (>= 3.7.100.14)
- DnsClient (>= 1.6.1)
- Microsoft.Extensions.Logging.Abstractions (>= 2.0.0)
- MongoDB.Bson (>= 2.30.0)
- MongoDB.Libmongocrypt (>= 1.12.0)
- SharpCompress (>= 0.30.1)
- Snappier (>= 1.0.0)
- System.Buffers (>= 4.5.1)
- ZstdSharp.Port (>= 0.7.3)
-
.NETStandard 2.1
- AWSSDK.SecurityToken (>= 3.7.100.14)
- DnsClient (>= 1.6.1)
- Microsoft.Extensions.Logging.Abstractions (>= 2.0.0)
- MongoDB.Bson (>= 2.30.0)
- MongoDB.Libmongocrypt (>= 1.12.0)
- SharpCompress (>= 0.30.1)
- Snappier (>= 1.0.0)
- System.Buffers (>= 4.5.1)
- ZstdSharp.Port (>= 0.7.3)
NuGet packages (266)
Showing the top 5 NuGet packages that depend on MongoDB.Driver.Core:
Package | Downloads |
---|---|
MongoDB.Driver.GridFS
GridFS Component of the Official MongoDB .NET Driver. |
|
Elastic.Apm.MongoDb
Elastic APM integration with the MongoDB.Driver package. |
|
mongocsharpdriver
This package contains the legacy driver. The new driver's package name is MongoDB.Driver |
|
ExtentReports.Core
Forked from extent-framework/extentreports-csharp. Modified version of Extent Reporting Framework, Community Edition, supporting .NET Core and .NET Standard |
|
Naos.Deployment.Persistence
Created on 2025-05-06 20:34 |
GitHub repositories (34)
Showing the top 20 popular GitHub repositories that depend on MongoDB.Driver.Core:
Repository | Stars |
---|---|
ServiceStack/ServiceStack
Thoughtfully architected, obscenely fast, thoroughly enjoyable web services for all
|
|
anjoy8/Blog.Core
💖 ASP.NET Core 8.0 全家桶教程,前后端分离后端接口,vue教程姊妹篇,官方文档:
|
|
fanliang11/surging
Surging is a micro-service engine that provides a lightweight, high-performance, modular RPC request pipeline. support Event-based Asynchronous Pattern and reactive programming ,The service engine supports http, TCP, WS,Grpc, Thrift,Mqtt, UDP, and DNS protocols. It uses ZooKeeper and Consul as a registry, and integrates it. Hash, random, polling, Fair Polling as a load balancing algorithm, built-in service governance to ensure reliable RPC communication, the engine contains Diagnostic, link tracking for protocol and middleware calls, and integration SkyWalking Distributed APM
|
|
FastReports/FastReport
Free Open Source Reporting tool for .NET6/.NET Core/.NET Framework that helps your application generate document-like reports
|
|
grandnode/grandnode
Open source, headless, multi-tenant eCommerce platform built with .NET Core, MongoDB, AWS DocumentDB, Azure CosmosDB, Vue.js.
|
|
SkyAPM/SkyAPM-dotnet
The .NET/.NET Core instrument agent for Apache SkyWalking
|
|
streetwriters/notesnook-sync-server
Sync server for Notesnook (self-hosting in alpha)
|
|
elastic/apm-agent-dotnet
|
|
imazen/resizer
The official repository for ImageResizer
|
|
magicdict/MongoCola
A MongoDB Administration Tool
|
|
fullstackhero/dotnet-microservices-boilerplate
The Ultimate Microservices Starter Kit for .NET Developers!
|
|
DataDog/dd-trace-dotnet
.NET Client Library for Datadog APM
|
|
zkweb-framework/ZKWeb
A flexible web framework supports .Net Framework and .Net Core
|
|
Eventuous/eventuous
Event Sourcing library for .NET
|
|
yukuyoulei/ILRuntime_HotGames
基于ILRuntime的热更新能力实现的可以直接使用的框架,友情赠送C# WebService + WebSocketServer服务器端。
|
|
daxnet/Apworks
Apworks is a flexible, scalable, configurable and efficient .NET based application development framework that helps software developers to easily build enterprise applications by applying either Classic Layering or Command-Query Responsibility Segregation (CQRS) architectural patterns.
|
|
alexandre-spieser/mongodb-generic-repository
An example of generic repository implementation using the MongoDB C# Sharp 2.0 driver (async)
|
|
TcOpenGroup/TcOpen
Application framework for industrial automation built on top of TwinCAT3 and .NET.
|
|
roadkillwiki/roadkill
A modern .NET Wiki
|
|
yc-l/yc.boilerplate
YC. Boilerplate is a set of loose coupling, flexible combination, complete functions, convenient development, and reduces the workload of development.
|
Version | Downloads | Last updated |
---|---|---|
2.30.0 | 2,798,196 | 10/16/2024 |
2.29.0 | 1,998,155 | 9/18/2024 |
2.28.0 | 9,806,297 | 7/23/2024 |
2.27.0 | 3,223,831 | 6/28/2024 |
2.26.0 | 1,286,379 | 6/12/2024 |
2.25.0 | 5,418,944 | 4/12/2024 |
2.24.0 | 4,331,613 | 2/21/2024 |
2.23.2 | 158,414 | 2/20/2024 |
2.23.1 | 6,016,086 | 12/15/2023 |
2.23.0 | 632,661 | 12/11/2023 |
2.22.0 | 8,352,613 | 10/9/2023 |
2.21.0 | 5,185,422 | 8/10/2023 |
2.20.0 | 5,724,127 | 6/21/2023 |
2.19.2 | 3,230,122 | 5/25/2023 |
2.19.1 | 7,471,703 | 3/27/2023 |
2.19.0 | 11,002,691 | 1/27/2023 |
2.18.0 | 9,643,312 | 10/14/2022 |
2.17.1 | 10,611,300 | 7/30/2022 |
2.17.0 | 1,289,680 | 7/18/2022 |
2.16.1 | 2,288,420 | 6/21/2022 |
2.16.0 | 1,420,067 | 6/7/2022 |
2.15.1 | 4,122,164 | 5/4/2022 |
2.15.0 | 4,741,323 | 3/9/2022 |
2.14.1 | 13,466,042 | 12/3/2021 |
2.14.0 | 1,442,488 | 11/24/2021 |
2.14.0-beta1 | 59,334 | 10/15/2021 |
2.13.3 | 5,172,319 | 11/23/2021 |
2.13.2 | 9,234,716 | 10/6/2021 |
2.13.1 | 6,368,371 | 8/4/2021 |
2.13.0 | 1,635,928 | 7/13/2021 |
2.13.0-beta1 | 64,407 | 3/31/2021 |
2.12.5 | 110,196 | 11/20/2021 |
2.12.4 | 2,958,946 | 6/4/2021 |
2.12.3 | 2,530,390 | 5/4/2021 |
2.12.2 | 2,457,738 | 4/7/2021 |
2.12.1 | 1,404,878 | 3/23/2021 |
2.12.0 | 5,099,184 | 3/3/2021 |
2.12.0-beta1 | 129,623 | 11/6/2020 |
2.11.6 | 9,812,909 | 1/20/2021 |
2.11.5 | 3,736,091 | 12/2/2020 |
2.11.4 | 2,388,166 | 11/4/2020 |
2.11.3 | 2,933,437 | 10/15/2020 |
2.11.2 | 6,369,035 | 9/10/2020 |
2.11.1 | 1,190,752 | 8/25/2020 |
2.11.0 | 2,120,309 | 7/30/2020 |
2.11.0-beta2 | 27,138 | 6/10/2020 |
2.11.0-beta1 | 63,784 | 4/10/2020 |
2.10.4 | 8,979,046 | 5/5/2020 |
2.10.3 | 1,944,826 | 4/7/2020 |
2.10.2 | 5,756,062 | 2/14/2020 |
2.10.1 | 3,269,377 | 1/15/2020 |
2.10.0 | 7,363,496 | 12/10/2019 |
2.10.0-beta1 | 48,063 | 10/2/2019 |
2.9.3 | 3,581,246 | 11/8/2019 |
2.9.2 | 4,035,509 | 9/30/2019 |
2.9.1 | 7,304,136 | 8/21/2019 |
2.9.0 | 355,099 | 8/15/2019 |
2.9.0-beta2 | 41,731 | 6/17/2019 |
2.9.0-beta1 | 53,365 | 3/13/2019 |
2.8.1 | 7,185,390 | 5/15/2019 |
2.8.0 | 5,134,187 | 3/13/2019 |
2.7.3 | 2,811,601 | 1/24/2019 |
2.7.2 | 4,783,770 | 11/10/2018 |
2.7.1 | 53,912 | 11/8/2018 |
2.7.0 | 6,499,786 | 6/27/2018 |
2.7.0-beta0001 | 37,102 | 4/22/2018 |
2.6.1 | 1,370,214 | 5/17/2018 |
2.6.0 | 759,889 | 4/24/2018 |
2.5.1 | 760,098 | 4/19/2018 |
2.5.0 | 3,477,793 | 12/12/2017 |
2.4.4 | 16,178,285 | 6/8/2017 |
2.4.3 | 1,311,600 | 3/9/2017 |
2.4.2 | 439,155 | 2/2/2017 |
2.4.1 | 203,655 | 1/4/2017 |
2.4.0 | 784,873 | 11/29/2016 |
2.4.0-beta1 | 21,156 | 10/5/2016 |
2.3.0 | 8,425,938 | 9/23/2016 |
2.3.0-rc1 | 91,609 | 8/29/2016 |
2.3.0-beta1 | 13,151 | 8/3/2016 |
2.2.4 | 877,132 | 5/18/2016 |
2.2.3 | 556,872 | 2/2/2016 |
2.2.2 | 65,147 | 1/15/2016 |
2.2.1 | 25,939 | 1/8/2016 |
2.2.0 | 155,266 | 12/7/2015 |
2.2.0-rc0 | 6,268 | 11/18/2015 |
2.1.1 | 183,138 | 11/11/2015 |
2.1.0 | 105,485 | 10/19/2015 |
2.1.0-rc1 | 10,493 | 10/7/2015 |
2.1.0-rc0 | 7,939 | 9/17/2015 |
2.0.2 | 67,799 | 11/11/2015 |
2.0.1 | 384,186 | 6/8/2015 |
2.0.0 | 408,222 | 4/2/2015 |
2.0.0-rc0 | 18,189 | 3/17/2015 |
2.0.0-beta4 | 4,858 | 3/9/2015 |
2.0.0-beta3 | 4,422 | 3/5/2015 |
2.0.0-beta2 | 5,494 | 2/4/2015 |
2.0.0-beta1 | 6,000 | 1/16/2015 |