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

No packages depend on mongocsharpdriver.

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

.NET Framework 4.7.2

.NET Standard 2.0

.NET Standard 2.1

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