mongocsharpdriver 2.28.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.

No packages depend on mongocsharpdriver.

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

.NET Framework 4.7.2

.NET Standard 2.0

.NET Standard 2.1

Version Downloads Last updated
2.30.0 2 10/17/2024
2.29.0 3 09/23/2024
2.28.0 5 07/27/2024
2.27.0 8 06/28/2024
2.26.0 8 06/26/2024
2.25.0 7 04/25/2024
2.24.0 12 03/03/2024
2.23.2 10 03/03/2024
2.23.1 9 12/30/2023
2.23.0 10 12/30/2023
2.22.0 16 11/28/2023
2.21.0 13 10/24/2023
2.20.0 15 10/04/2023
2.19.2 16 06/04/2023
2.19.1 14 06/05/2023
2.19.0 15 06/05/2023
2.18.0 12 06/05/2023
2.17.1 14 06/05/2023
2.17.0 18 06/05/2023
2.16.1 16 06/05/2023
2.16.0 14 06/05/2023
2.15.1 16 06/05/2023
2.15.0 18 06/05/2023
2.14.1 14 06/05/2023
2.14.0 17 06/05/2023
2.14.0-beta1 16 06/05/2023
2.13.3 16 06/05/2023
2.13.2 17 11/12/2021
2.13.1 16 06/05/2023
2.13.0 14 06/05/2023
2.13.0-beta1 14 06/05/2023
2.12.5 17 06/05/2023
2.12.4 16 06/05/2023
2.12.3 627 05/24/2021
2.12.2 17 06/05/2023
2.12.1 17 06/05/2023
2.12.0 121 03/19/2021
2.12.0-beta1 13 06/05/2023
2.11.6 88 03/01/2021
2.11.5 205 12/16/2020
2.11.4 16 06/05/2023
2.11.3 13 06/05/2023
2.11.2 18 06/05/2023
2.11.1 18 06/05/2023
2.11.0 13 06/05/2023
2.11.0-beta2 11 06/05/2023
2.11.0-beta1 17 06/05/2023
2.10.4 14 06/05/2023
2.10.3 20 06/05/2023
2.10.2 19 06/05/2023
2.10.1 16 06/05/2023
2.10.0 20 06/05/2023
2.10.0-beta1 16 06/05/2023
2.9.3 19 06/05/2023
2.9.2 16 06/05/2023
2.9.1 15 06/05/2023
2.9.0 19 06/05/2023
2.9.0-beta2 18 06/05/2023
2.9.0-beta1 20 06/05/2023
2.8.1 20 06/05/2023
2.8.0 16 06/05/2023
2.7.3 16 06/05/2023
2.7.2 15 06/05/2023
2.7.1 16 06/05/2023
2.7.0 16 06/05/2023
2.7.0-beta0001 12 06/05/2023
2.6.1 15 06/05/2023
2.6.0 18 06/05/2023
2.5.1 19 06/05/2023
2.5.0 15 06/05/2023
2.4.4 16 06/05/2023
2.4.3 20 06/05/2023
2.4.2 17 06/05/2023
2.4.1 16 06/05/2023
2.4.0 18 06/05/2023
2.4.0-beta1 16 06/05/2023
2.3.0 15 06/05/2023
2.3.0-rc1 16 06/05/2023
2.3.0-beta1 12 06/05/2023
2.2.4 16 06/05/2023
2.2.3 18 06/05/2023
2.2.2 15 06/05/2023
2.2.1 18 06/05/2023
2.2.0 19 06/05/2023
2.2.0-rc0 14 06/05/2023
2.1.1 16 06/05/2023
2.1.0 16 06/05/2023
2.1.0-rc1 13 06/05/2023
2.1.0-rc0 16 06/05/2023
2.0.2 13 06/05/2023
2.0.1 16 06/05/2023
2.0.0 18 06/05/2023
2.0.0-rc0 13 06/05/2023
2.0.0-beta4 15 06/05/2023
2.0.0-beta3 14 06/05/2023
2.0.0-beta2 16 06/05/2023
2.0.0-beta1 15 06/05/2023
1.11.0 15 06/05/2023
1.11.0-rc0 14 06/05/2023
1.10.1 12 06/05/2023
1.10.0 11 06/05/2023
1.10.0-rc1 17 06/05/2023
1.10.0-rc0 12 06/05/2023
1.9.2 12 06/05/2023
1.9.1 18 06/05/2023
1.9.0 19 06/05/2023
1.8.3 15 06/05/2023
1.8.2 18 06/05/2023
1.8.1 16 06/05/2023
1.8.0 16 06/05/2023
1.7.1 16 06/05/2023
1.7.0 22 06/05/2023
1.6.1 17 06/05/2023
1.6.0 16 06/05/2023
1.5.0 17 06/05/2023
1.4.2 17 06/05/2023
1.4.1 15 06/05/2023
1.4.0 16 06/05/2023
1.3.1 15 06/05/2023
1.3.0 18 06/05/2023
1.2.0 14 06/05/2023
1.1.0 15 06/05/2023
1.0.0 17 06/05/2023
0.11.0.4042 12 06/05/2023