MongoDB.Driver.Core 2.29.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.

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

Packages Downloads
MongoDB.Driver
Official .NET driver for MongoDB.
78
MongoDB.Driver
Official .NET driver for MongoDB.
68
MongoDB.Driver
Official .NET driver for MongoDB.
52
MongoDB.Driver
Official .NET driver for MongoDB.
51
MongoDB.Driver
Official .NET driver for MongoDB.
50
MongoDB.Driver.GridFS
GridFS Component of the Official MongoDB .NET Driver.
50
MongoDB.Driver
Official .NET driver for MongoDB.
49
MongoDB.Driver.GridFS
GridFS Component of the Official MongoDB .NET Driver.
49
MongoDB.Driver.GridFS
GridFS Component of the Official MongoDB .NET Driver.
48
MongoDB.Driver.GridFS
GridFS Component of the Official MongoDB .NET Driver.
47
MongoDB.Driver
Official .NET driver for MongoDB.
47

https://github.com/mongodb/mongo-csharp-driver/releases/tag/v2.29.0

Version Downloads Last updated
2.30.0 36 10/19/2024
2.29.0 25 09/19/2024
2.28.0 39 07/25/2024
2.27.0 40 06/28/2024
2.26.0 42 06/13/2024
2.25.0 34 04/21/2024
2.24.0 33 02/27/2024
2.23.2 38 02/27/2024
2.23.1 34 12/19/2023
2.23.0 33 12/19/2023
2.22.0 46 10/19/2023
2.21.0 44 08/11/2023
2.20.0 44 07/01/2023
2.19.2 46 06/04/2023
2.19.1 49 05/01/2023
2.19.0 37 07/12/2023
2.18.0 41 07/11/2023
2.17.1 37 03/28/2023
2.17.0 37 07/18/2023
2.16.1 40 07/19/2023
2.16.0 40 07/28/2022
2.15.1 39 09/04/2022
2.15.0 37 07/11/2023
2.14.1 35 06/23/2023
2.14.0 37 07/18/2023
2.14.0-beta1 42 09/27/2022
2.13.3 39 07/21/2023
2.13.2 61 07/19/2022
2.13.1 38 08/21/2022
2.13.0 39 09/15/2023
2.13.0-beta1 40 07/22/2023
2.12.5 33 07/24/2023
2.12.4 39 06/23/2023
2.12.3 44 07/20/2023
2.12.2 42 07/19/2023
2.12.1 42 07/27/2022
2.12.0 43 10/30/2022
2.12.0-beta1 41 07/04/2023
2.11.6 45 06/11/2022
2.11.5 44 07/24/2023
2.11.4 44 03/15/2023
2.11.3 47 03/01/2023
2.11.2 45 07/28/2022
2.11.1 39 07/16/2023
2.11.0 40 07/16/2023
2.11.0-beta2 39 07/17/2023
2.11.0-beta1 38 07/21/2023
2.10.4 37 07/20/2023
2.10.3 38 07/11/2023
2.10.2 37 07/24/2023
2.10.1 49 07/14/2022
2.10.0 39 04/14/2023
2.10.0-beta1 46 06/23/2023
2.9.3 39 07/11/2023
2.9.2 40 01/10/2023
2.9.1 51 07/18/2023
2.9.0 40 07/21/2023
2.9.0-beta2 43 07/23/2023
2.9.0-beta1 41 07/06/2023
2.8.1 35 02/17/2023
2.8.0 40 10/17/2022
2.7.3 44 07/17/2023
2.7.2 44 07/21/2023
2.7.1 43 07/17/2023
2.7.0 41 12/05/2022
2.7.0-beta0001 34 07/22/2023
2.6.1 45 07/18/2023
2.6.0 40 07/22/2023
2.5.1 47 09/02/2022
2.5.0 39 08/17/2023
2.4.4 43 09/05/2022
2.4.3 43 07/13/2023
2.4.2 37 06/23/2023
2.4.1 43 08/06/2022
2.4.0 37 07/15/2023
2.4.0-beta1 37 12/04/2022
2.3.0 41 07/16/2022
2.3.0-rc1 39 04/10/2023
2.3.0-beta1 37 07/21/2023
2.2.4 40 07/18/2023
2.2.3 36 07/20/2023
2.2.2 38 06/04/2023
2.2.1 37 07/20/2023
2.2.0 46 11/18/2022
2.2.0-rc0 38 07/14/2023
2.1.1 38 07/20/2023
2.1.0 35 07/24/2023
2.1.0-rc1 36 07/13/2023
2.1.0-rc0 42 07/16/2023
2.0.2 42 07/22/2023
2.0.1 42 09/01/2022
2.0.0 41 07/22/2023
2.0.0-rc0 38 07/23/2023
2.0.0-beta4 37 10/08/2022
2.0.0-beta3 37 07/14/2023
2.0.0-beta2 37 07/16/2023
2.0.0-beta1 50 10/05/2022