MongoDB.Driver 3.11.1

MongoDB C# Driver

MongoDB.Driver Documentation Documentation License

The official MongoDB .NET/C# driver.

The MongoDB .NET/C# driver follows semantic versioning since v3.0.0 of its releases.

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.

Showing the top 20 packages that depend on MongoDB.Driver.

Packages Downloads
FormCMS
A headless CMS with GraphQL API and drag-and-drop page designer.
56
MongoDB.Driver.GridFS
GridFS Component of the Official MongoDB .NET Driver.
54
MongoDB.Driver.Core.Extensions.DiagnosticSources
Package Description
54
Aspire.Hosting.MongoDB
MongoDB support for Aspire.
52
MassTransit.MongoDb
MassTransit MongoDb persistence support; MassTransit provides a developer-focused, modern platform for creating distributed applications without complexity.
52
FormCMS
A headless CMS with GraphQL API and drag-and-drop page designer.
51
FormCMS
A headless CMS with GraphQL API and drag-and-drop page designer.
50
FormCMS
A headless CMS with GraphQL API and drag-and-drop page designer.
49
AspNetCore.HealthChecks.MongoDb
HealthChecks.MongoDb is the health check package for MongoDb.
48
MongoDB.Driver.GridFS
GridFS Component of the Official MongoDB .NET Driver.
48
FormCMS
A headless CMS with GraphQL API and drag-and-drop page designer.
48
FormCMS
A headless CMS with GraphQL API and drag-and-drop page designer.
46

Version Downloads Last updated
3.12.0 4 09/18/2026
3.11.2 9 09/11/2026
3.11.1 16 08/27/2026
3.11.0 14 08/13/2026
3.10.0 19 07/14/2026
3.9.0 33 05/29/2026
3.8.1 27 05/13/2026
3.8.0 41 04/23/2026
3.7.1 53 03/22/2026
3.7.0 51 03/04/2026
3.6.0 67 01/16/2026
3.5.2 56 12/10/2025
3.5.1 40 12/31/2025
3.5.0 51 12/31/2025
3.4.3 44 12/11/2025
3.4.2 53 12/10/2025
3.4.1 50 12/10/2025
3.4.0 42 12/20/2025
3.3.0 49 12/31/2025
3.2.1 41 12/20/2025
3.2.0 49 12/20/2025
3.1.0 46 12/20/2025
3.0.0 48 12/15/2025
2.30.0 30 12/31/2025
2.29.0 35 12/18/2025
2.28.0 44 12/20/2025
2.27.0 33 12/15/2025
2.26.0 43 12/16/2025
2.25.0 39 12/15/2025
2.24.0 39 12/11/2025
2.23.2 34 12/13/2025
2.23.1 34 12/12/2025
2.23.0 33 12/19/2025
2.22.0 39 12/29/2025
2.21.0 36 12/26/2025
2.20.0 60 12/31/2025
2.19.2 37 12/13/2025
2.19.1 39 12/16/2025
2.19.0 42 12/22/2025
2.18.0 36 12/16/2025
2.17.1 50 12/12/2025
2.17.0 38 12/18/2025
2.16.1 40 12/25/2025
2.16.0 38 12/09/2025
2.15.1 33 12/25/2025
2.15.0 49 12/11/2025
2.14.1 42 12/14/2025
2.14.0 45 12/13/2025
2.14.0-beta1 41 12/24/2025
2.13.3 38 12/17/2025
2.13.2 39 12/17/2025
2.13.1 42 12/14/2025
2.13.0 37 12/18/2025
2.13.0-beta1 37 12/18/2025
2.12.5 44 12/10/2025
2.12.4 42 12/10/2025
2.12.3 44 12/31/2025
2.12.2 36 12/31/2025
2.12.1 44 12/11/2025
2.12.0 39 12/28/2025
2.12.0-beta1 39 01/01/2026
2.11.6 35 12/19/2025
2.11.5 39 12/13/2025
2.11.4 44 12/15/2025
2.11.3 43 12/22/2025
2.11.2 39 12/23/2025
2.11.1 42 12/13/2025
2.11.0 46 12/31/2025
2.11.0-beta2 38 12/11/2025
2.11.0-beta1 34 12/29/2025
2.10.4 40 12/23/2025
2.10.3 38 12/15/2025
2.10.2 35 12/11/2025
2.10.1 37 12/31/2025
2.10.0 39 12/20/2025
2.10.0-beta1 38 12/19/2025
2.9.3 35 12/18/2025
2.9.2 36 12/15/2025
2.9.1 34 12/11/2025
2.9.0 36 12/20/2025
2.9.0-beta2 41 12/13/2025
2.9.0-beta1 41 12/10/2025
2.8.1 41 12/20/2025
2.8.0 32 12/11/2025
2.7.3 37 12/20/2025
2.7.2 40 12/20/2025
2.7.1 35 12/11/2025
2.7.0 43 12/18/2025
2.7.0-beta0001 40 12/20/2025
2.6.1 43 12/20/2025
2.6.0 37 12/12/2025
2.5.1 32 12/15/2025
2.5.0 37 12/15/2025
2.4.4 33 12/11/2025
2.4.3 34 12/20/2025
2.4.2 37 12/11/2025
2.4.1 35 12/20/2025
2.4.0 37 12/10/2025
2.4.0-beta1 38 12/31/2025
2.3.0 43 12/20/2025
2.3.0-rc1 34 12/18/2025
2.3.0-beta1 36 12/13/2025
2.2.4 41 12/20/2025
2.2.3 32 12/20/2025
2.2.2 38 12/24/2025
2.2.1 36 12/13/2025
2.2.0 35 12/20/2025
2.2.0-rc0 27 12/17/2025
2.1.1 34 12/20/2025
2.1.0 38 12/20/2025
2.1.0-rc1 39 12/10/2025
2.1.0-rc0 33 12/13/2025
2.0.2 38 12/20/2025
2.0.1 33 12/11/2025
2.0.0 36 12/20/2025
2.0.0-rc0 30 12/21/2025
2.0.0-beta4 36 12/29/2025
2.0.0-beta3 37 12/31/2025
2.0.0-beta2 34 12/31/2025
2.0.0-beta1 30 12/16/2025