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.
210
MongoDB.Driver
Official .NET driver for MongoDB.
198
MongoDB.Driver.GridFS
GridFS Component of the Official MongoDB .NET Driver.
195
Flowaccount.Data
Application Core
110
Flowaccount.Data
Application Core
73
Flowaccount.Data
Application Core
72
MongoDB.Driver
Official .NET driver for MongoDB.
66
Flowaccount.Data
Application Core
64
Flowaccount.Data
Application Core
61
Flowaccount.Data
Application Core
57
Flowaccount.Data
Application Core
54
MongoDB.Driver
Official .NET driver for MongoDB.
52
Flowaccount.Data
Application Core
51
Flowaccount.Data
Application Core
49
MongoDB.Driver
Official .NET driver for MongoDB.
48
Flowaccount.Data
Application Core
48

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

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