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

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

Packages Downloads
MongoDB.Driver.GridFS
GridFS Component of the Official MongoDB .NET Driver.
496
MongoDB.Driver
Official .NET driver for MongoDB.
209
MongoDB.Driver
Official .NET driver for MongoDB.
197
MongoDB.Driver.GridFS
GridFS Component of the Official MongoDB .NET Driver.
195
Flowaccount.Data
Application Core
107
Flowaccount.Data
Application Core
73
Flowaccount.Data
Application Core
72
MongoDB.Driver
Official .NET driver for MongoDB.
65
Flowaccount.Data
Application Core
64
Flowaccount.Data
Application Core
61
Flowaccount.Data
Application Core
60
Flowaccount.Data
Application Core
54
Flowaccount.Data
Application Core
52
Flowaccount.Data
Application Core
51
MongoDB.Driver
Official .NET driver for MongoDB.
51
Flowaccount.Data
Application Core
48
MongoDB.Driver
Official .NET driver for MongoDB.
47
MongoDB.Driver.GridFS
GridFS Component of the Official MongoDB .NET Driver.
47

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

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