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.
499
MongoDB.Driver
Official .NET driver for MongoDB.
215
MongoDB.Driver
Official .NET driver for MongoDB.
201
MongoDB.Driver.GridFS
GridFS Component of the Official MongoDB .NET Driver.
199
Flowaccount.Data
Application Core
115
Flowaccount.Data
Application Core
77
Flowaccount.Data
Application Core
69
MongoDB.Driver
Official .NET driver for MongoDB.
69
Flowaccount.Data
Application Core
65
Flowaccount.Data
Application Core
64
Flowaccount.Data
Application Core
61
Flowaccount.Data
Application Core
58
Flowaccount.Data
Application Core
56
MongoDB.Driver
Official .NET driver for MongoDB.
55
Flowaccount.Data
Application Core
53
Flowaccount.Data
Application Core
52
MongoDB.Driver
Official .NET driver for MongoDB.
52

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

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