MongoDB.Driver 3.3.0

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

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 Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
.NET Framework net472 is compatible.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2.8K)

Showing the top 5 NuGet packages that depend on MongoDB.Driver:

Package Downloads
AspNetCore.HealthChecks.MongoDb

HealthChecks.MongoDb is the health check package for MongoDb.

MongoDB.Driver.GridFS

GridFS Component of the Official MongoDB .NET Driver.

mongocsharpdriver

This package contains the legacy driver. The new driver's package name is MongoDB.Driver

MongoDB.Driver.Core.Extensions.DiagnosticSources

Package Description

Mongo2Go

Mongo2Go is a managed wrapper around MongoDB binaries. It targets .NET Framework 4.7.2 and .NET Standard 2.1. This Nuget package contains the executables of mongod, mongoimport and mongoexport v4.4.4 for Windows, Linux and macOS. Mongo2Go has two use cases: 1. Providing multiple, temporary and isolated MongoDB databases for integration tests 2. Providing a quick to set up MongoDB database for a local developer environment

GitHub repositories (200)

Showing the top 20 popular GitHub repositories that depend on MongoDB.Driver:

Repository Stars
microsoft/semantic-kernel
Integrate cutting-edge LLM technology quickly and easily into your apps
abpframework/abp
Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
dotnet/AspNetCore.Docs
Documentation for ASP.NET Core
MassTransit/MassTransit
Distributed Application Framework for .NET
elsa-workflows/elsa-core
A .NET workflows library
dotnetcore/CAP
Distributed transaction solution in micro-service base on eventually consistency, also an eventbus with Outbox pattern
ldqk/Masuit.Tools
全龄段友好的C#万能工具库,码数吐司库,包含一些常用的操作类,大都是静态类,加密解密,反射操作,权重随机筛选算法,分布式短id,表达式树,linq扩展,文件压缩,多线程下载,硬件信息,字符串扩展方法,日期时间扩展操作,中国农历,大文件拷贝,图像裁剪,验证码,断点续传,集合扩展、Excel导出等常用封装。诸多功能集一身,代码量不到2MB!
danielgerlag/workflow-core
Lightweight workflow engine for .NET Standard
ServiceStack/ServiceStack
Thoughtfully architected, obscenely fast, thoroughly enjoyable web services for all
ChilliCream/graphql-platform
Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Nitro the awesome Monaco based GraphQL IDE.
anjoy8/Blog.Core
💖 ASP.NET Core 8.0 全家桶教程,前后端分离后端接口,vue教程姊妹篇,官方文档:
openiddict/openiddict-core
Flexible and versatile OAuth 2.0/OpenID Connect stack for .NET
dotnet/aspire
Tools, templates, and packages to accelerate building observable, production-ready apps
Xabaril/AspNetCore.Diagnostics.HealthChecks
Enterprise HealthChecks for ASP.NET Core Diagnostics Package
dotnetcore/DotnetSpider
DotnetSpider, a .NET standard web crawling library. It is lightweight, efficient and fast high-level web crawling & scraping framework
testcontainers/testcontainers-dotnet
A library to support tests with throwaway instances of Docker containers for all compatible .NET Standard versions.
ravendb/ravendb
ACID Document Database
oskardudycz/EventSourcing.NetCore
Examples and Tutorials of Event Sourcing in .NET
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
mongodb/mongo-csharp-driver
The Official C# .NET Driver for MongoDB
Version Downloads Last updated
3.3.0 127,612 17 days ago
3.2.1 637,138 2 months ago
3.2.0 198,262 2 months ago
3.1.0 1,715,030 4 months ago
3.0.0 2,283,784 6 months ago
2.30.0 2,090,137 6 months ago
2.29.0 1,775,587 7 months ago
2.28.0 6,896,343 9 months ago
2.27.0 2,915,548 10 months ago
2.26.0 1,205,407 6/12/2024
2.25.0 5,074,310 4/12/2024
2.24.0 4,110,250 2/21/2024
2.23.2 150,032 2/20/2024
2.23.1 5,749,963 12/15/2023
2.23.0 605,101 12/11/2023
2.22.0 7,915,899 10/9/2023
2.21.0 4,921,217 8/10/2023
2.20.0 5,574,618 6/21/2023
2.19.2 3,090,162 5/25/2023
2.19.1 7,210,901 3/27/2023
2.19.0 8,390,420 1/27/2023
2.18.0 9,362,302 10/14/2022 2.18.0 has at least one vulnerability with high severity.
2.17.1 10,376,963 7/30/2022 2.17.1 has at least one vulnerability with high severity.
2.17.0 1,245,762 7/18/2022 2.17.0 has at least one vulnerability with high severity.
2.16.1 2,227,962 6/21/2022 2.16.1 has at least one vulnerability with high severity.
2.16.0 1,338,703 6/7/2022 2.16.0 has at least one vulnerability with high severity.
2.15.1 3,841,760 5/4/2022 2.15.1 has at least one vulnerability with high severity.
2.15.0 4,592,820 3/9/2022 2.15.0 has at least one vulnerability with high severity.
2.14.1 13,247,128 12/3/2021 2.14.1 has at least one vulnerability with high severity.
2.14.0 1,394,950 11/24/2021 2.14.0 has at least one vulnerability with high severity.
2.14.0-beta1 56,632 10/15/2021 2.14.0-beta1 has at least one vulnerability with high severity.
2.13.3 1,171,208 11/23/2021 2.13.3 has at least one vulnerability with high severity.
2.13.2 9,026,561 10/6/2021 2.13.2 has at least one vulnerability with high severity.
2.13.1 6,298,781 8/4/2021 2.13.1 has at least one vulnerability with high severity.
2.13.0 1,606,810 7/13/2021 2.13.0 has at least one vulnerability with high severity.
2.13.0-beta1 61,804 3/31/2021 2.13.0-beta1 has at least one vulnerability with high severity.
2.12.5 104,895 11/20/2021 2.12.5 has at least one vulnerability with high severity.
2.12.4 2,881,799 6/4/2021 2.12.4 has at least one vulnerability with high severity.
2.12.3 2,481,745 5/4/2021 2.12.3 has at least one vulnerability with high severity.
2.12.2 2,422,252 4/7/2021 2.12.2 has at least one vulnerability with high severity.
2.12.1 1,355,249 3/23/2021 2.12.1 has at least one vulnerability with high severity.
2.12.0 4,977,332 3/3/2021 2.12.0 has at least one vulnerability with high severity.
2.12.0-beta1 130,343 11/6/2020 2.12.0-beta1 has at least one vulnerability with high severity.
2.11.6 9,594,187 1/20/2021 2.11.6 has at least one vulnerability with high severity.
2.11.5 3,645,258 12/2/2020 2.11.5 has at least one vulnerability with high severity.
2.11.4 2,305,963 11/4/2020 2.11.4 has at least one vulnerability with high severity.
2.11.3 2,924,576 10/15/2020 2.11.3 has at least one vulnerability with high severity.
2.11.2 6,345,546 9/10/2020 2.11.2 has at least one vulnerability with high severity.
2.11.1 1,167,556 8/25/2020 2.11.1 has at least one vulnerability with high severity.
2.11.0 2,063,735 7/30/2020 2.11.0 has at least one vulnerability with high severity.
2.11.0-beta2 25,776 6/10/2020 2.11.0-beta2 has at least one vulnerability with high severity.
2.11.0-beta1 56,570 4/10/2020 2.11.0-beta1 has at least one vulnerability with high severity.
2.10.4 8,761,373 5/5/2020 2.10.4 has at least one vulnerability with high severity.
2.10.3 1,886,635 4/7/2020 2.10.3 has at least one vulnerability with high severity.
2.10.2 5,675,551 2/14/2020 2.10.2 has at least one vulnerability with high severity.
2.10.1 3,210,386 1/15/2020 2.10.1 has at least one vulnerability with high severity.
2.10.0 7,047,307 12/10/2019 2.10.0 has at least one vulnerability with high severity.
2.10.0-beta1 46,320 10/2/2019 2.10.0-beta1 has at least one vulnerability with high severity.
2.9.3 3,507,254 11/8/2019 2.9.3 has at least one vulnerability with high severity.
2.9.2 3,996,365 9/30/2019 2.9.2 has at least one vulnerability with high severity.
2.9.1 7,235,860 8/21/2019 2.9.1 has at least one vulnerability with high severity.
2.9.0 346,899 8/15/2019 2.9.0 has at least one vulnerability with high severity.
2.9.0-beta2 40,459 6/17/2019 2.9.0-beta2 has at least one vulnerability with high severity.
2.9.0-beta1 51,219 3/13/2019 2.9.0-beta1 has at least one vulnerability with high severity.
2.8.1 6,962,537 5/15/2019 2.8.1 has at least one vulnerability with high severity.
2.8.0 5,014,626 3/13/2019 2.8.0 has at least one vulnerability with high severity.
2.7.3 2,741,558 1/24/2019 2.7.3 has at least one vulnerability with high severity.
2.7.2 4,715,196 11/10/2018 2.7.2 has at least one vulnerability with high severity.
2.7.1 51,024 11/8/2018 2.7.1 has at least one vulnerability with high severity.
2.7.0 6,506,238 6/27/2018 2.7.0 has at least one vulnerability with high severity.
2.7.0-beta0001 35,576 4/22/2018 2.7.0-beta0001 has at least one vulnerability with high severity.
2.6.1 1,342,989 5/17/2018 2.6.1 has at least one vulnerability with high severity.
2.6.0 756,821 4/24/2018 2.6.0 has at least one vulnerability with high severity.
2.5.1 749,132 4/19/2018 2.5.1 has at least one vulnerability with high severity.
2.5.0 3,451,405 12/12/2017 2.5.0 has at least one vulnerability with high severity.
2.4.4 3,556,013 6/8/2017 2.4.4 has at least one vulnerability with high severity.
2.4.3 1,297,201 3/9/2017 2.4.3 has at least one vulnerability with high severity.
2.4.2 420,643 2/2/2017 2.4.2 has at least one vulnerability with high severity.
2.4.1 196,951 1/4/2017 2.4.1 has at least one vulnerability with high severity.
2.4.0 661,658 11/29/2016 2.4.0 has at least one vulnerability with high severity.
2.4.0-beta1 19,877 10/5/2016 2.4.0-beta1 has at least one vulnerability with high severity.
2.3.0 4,998,872 9/23/2016 2.3.0 has at least one vulnerability with high severity.
2.3.0-rc1 90,027 8/29/2016 2.3.0-rc1 has at least one vulnerability with high severity.
2.3.0-beta1 11,730 8/3/2016 2.3.0-beta1 has at least one vulnerability with high severity.
2.2.4 872,431 5/18/2016 2.2.4 has at least one vulnerability with high severity.
2.2.3 543,827 2/2/2016 2.2.3 has at least one vulnerability with high severity.
2.2.2 61,448 1/15/2016 2.2.2 has at least one vulnerability with high severity.
2.2.1 24,790 1/8/2016 2.2.1 has at least one vulnerability with high severity.
2.2.0 154,647 12/7/2015 2.2.0 has at least one vulnerability with high severity.
2.2.0-rc0 5,025 11/18/2015 2.2.0-rc0 has at least one vulnerability with high severity.
2.1.1 181,333 11/11/2015 2.1.1 has at least one vulnerability with high severity.
2.1.0 98,607 10/19/2015 2.1.0 has at least one vulnerability with high severity.
2.1.0-rc1 8,969 10/7/2015 2.1.0-rc1 has at least one vulnerability with high severity.
2.1.0-rc0 6,695 9/17/2015 2.1.0-rc0 has at least one vulnerability with high severity.
2.0.2 65,434 11/11/2015 2.0.2 has at least one vulnerability with high severity.
2.0.1 376,158 6/8/2015 2.0.1 has at least one vulnerability with high severity.
2.0.0 412,918 4/2/2015 2.0.0 has at least one vulnerability with high severity.
2.0.0-rc0 16,833 3/17/2015 2.0.0-rc0 has at least one vulnerability with high severity.
2.0.0-beta4 3,380 3/9/2015 2.0.0-beta4 has at least one vulnerability with high severity.
2.0.0-beta3 2,959 3/5/2015 2.0.0-beta3 has at least one vulnerability with high severity.
2.0.0-beta2 4,107 2/4/2015 2.0.0-beta2 has at least one vulnerability with high severity.
2.0.0-beta1 4,162 1/16/2015 2.0.0-beta1 has at least one vulnerability with high severity.