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.
206
MongoDB.Driver
Official .NET driver for MongoDB.
197
MongoDB.Driver.GridFS
GridFS Component of the Official MongoDB .NET Driver.
194
Flowaccount.Data
Application Core
106
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
53
Flowaccount.Data
Application Core
52
Flowaccount.Data
Application Core
51
MongoDB.Driver
Official .NET driver for MongoDB.
51
Flowaccount.Data
Application Core
49
Flowaccount.Data
Application Core
48
MongoDB.Driver
Official .NET driver for MongoDB.
47
Flowaccount.Data
Application Core
46
MongoDB.Driver.GridFS
GridFS Component of the Official MongoDB .NET Driver.
46

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

Version Downloads Last updated
2.30.0 20 10/21/2024
2.29.0 13 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 15 03/14/2024
2.23.2 24 03/14/2024
2.23.1 17 12/21/2023
2.23.0 20 12/15/2023
2.22.0 18 12/15/2023
2.21.0 16 01/13/2024
2.20.0 21 08/16/2023
2.19.2 20 08/28/2023
2.19.1 50 04/24/2023
2.19.0 33 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 18 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 16 08/16/2022
2.14.0-beta1 18 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 22 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 20 08/30/2023
2.12.0 20 08/15/2022
2.12.0-beta1 22 08/24/2023
2.11.6 16 08/29/2023
2.11.5 18 08/30/2023
2.11.4 21 08/28/2023
2.11.3 18 08/28/2023
2.11.2 18 09/02/2023
2.11.1 20 08/24/2023
2.11.0 72 06/23/2021
2.11.0-beta2 20 08/29/2023
2.11.0-beta1 20 01/16/2021
2.10.4 51 07/02/2020
2.10.3 18 08/29/2023
2.10.2 18 08/29/2023
2.10.1 17 08/25/2023
2.10.0 14 08/26/2023
2.10.0-beta1 22 08/28/2023
2.9.3 19 06/14/2023
2.9.2 19 02/18/2024
2.9.1 18 02/18/2024
2.9.0 17 06/13/2023
2.9.0-beta2 16 02/15/2024
2.9.0-beta1 17 02/15/2024
2.8.1 17 06/14/2023
2.8.0 18 12/21/2023
2.7.3 17 02/18/2024
2.7.2 18 06/14/2023
2.7.1 19 06/14/2023
2.7.0 15 02/18/2024
2.7.0-beta0001 22 08/27/2023
2.6.1 164 11/15/2019
2.6.0 20 02/18/2024
2.5.1 17 02/18/2024
2.5.0 50 11/29/2019
2.4.4 183 11/14/2019
2.4.3 16 02/18/2024
2.4.2 17 02/18/2024
2.4.1 17 02/18/2024
2.4.0 17 02/18/2024
2.4.0-beta1 18 02/15/2024
2.3.0 17 03/06/2020
2.3.0-rc1 14 08/28/2023
2.3.0-beta1 20 02/15/2024
2.2.4 19 06/13/2023
2.2.3 20 02/18/2024
2.2.2 15 02/18/2024
2.2.1 16 02/18/2024
2.2.0 18 02/18/2024
2.2.0-rc0 16 02/18/2024
2.1.1 15 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 20 02/18/2024
2.0.1 15 06/14/2023
2.0.0 18 02/18/2024
2.0.0-rc0 18 05/17/2023
2.0.0-beta4 21 02/15/2024
2.0.0-beta3 21 02/15/2024
2.0.0-beta2 20 02/15/2024
2.0.0-beta1 17 02/15/2024