MongoDB.Driver 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.
Packages | Downloads |
---|---|
AspNetCore.HealthChecks.MongoDb
HealthChecks.MongoDb is the health check package for MongoDb.
|
157 |
MongoDB.Driver.GridFS
GridFS Component of the Official MongoDB .NET Driver.
|
64 |
MongoDB.Entities
A data access library for MongoDB with an elegant api, LINQ support and built-in entity relationship management.
|
44 |
MassTransit.MongoDb
MassTransit MongoDb persistence support; MassTransit is a message-based distributed application framework for .NET http://masstransit-project.com
|
34 |
MongoDB.Entities
A data access library for MongoDB with an elegant api, LINQ support and built-in entity relationship management.
|
14 |
mongocsharpdriver
This package contains the legacy driver. The new driver's package name is MongoDB.Driver
|
8 |
mongocsharpdriver
This package contains the legacy driver. The new driver's package name is MongoDB.Driver
|
7 |
MassTransit.MongoDb
MassTransit MongoDb persistence support; MassTransit provides a developer-focused, modern platform for creating distributed applications without complexity.
|
6 |
MassTransit.MongoDb
MassTransit MongoDb persistence support; MassTransit is a message-based distributed application framework for .NET http://masstransit-project.com
|
5 |
MassTransit.MongoDb
MassTransit MongoDb persistence support; MassTransit provides a developer-focused, modern platform for creating distributed applications without complexity.
|
5 |
MongoDB.Driver.GridFS
GridFS Component of the Official MongoDB .NET Driver.
|
5 |
MongoDB.Entities
A data access library for MongoDB with an elegant api, LINQ support and built-in entity relationship management.
|
5 |
ExtentReports
Extent Reporting Framework (.Net Standard), Community Edition
|
5 |
mongocsharpdriver
This package contains the legacy driver. The new driver's package name is MongoDB.Driver.
|
5 |
mongocsharpdriver
This package contains the legacy driver. The new driver's package name is MongoDB.Driver
|
5 |
https://github.com/mongodb/mongo-csharp-driver/releases/tag/v2.30.0
.NET Framework 4.7.2
- MongoDB.Bson (>= 2.30.0)
- MongoDB.Driver.Core (>= 2.30.0)
- Microsoft.Extensions.Logging.Abstractions (>= 2.0.0)
- MongoDB.Libmongocrypt (>= 1.12.0)
.NET Standard 2.0
- MongoDB.Bson (>= 2.30.0)
- MongoDB.Driver.Core (>= 2.30.0)
- Microsoft.Extensions.Logging.Abstractions (>= 2.0.0)
- MongoDB.Libmongocrypt (>= 1.12.0)
.NET Standard 2.1
- MongoDB.Bson (>= 2.30.0)
- MongoDB.Driver.Core (>= 2.30.0)
- Microsoft.Extensions.Logging.Abstractions (>= 2.0.0)
- MongoDB.Libmongocrypt (>= 1.12.0)
Version | Downloads | Last updated |
---|---|---|
3.1.0 | 2 | 12/18/2024 |
3.0.0 | 2 | 11/25/2024 |
2.30.0 | 3 | 11/25/2024 |
2.29.0 | 4 | 11/25/2024 |
2.28.0 | 3 | 10/09/2024 |
2.27.0 | 2 | 11/25/2024 |
2.26.0 | 4 | 10/09/2024 |
2.25.0 | 5 | 10/04/2024 |
2.24.0 | 5 | 06/08/2024 |
2.23.2 | 3 | 10/09/2024 |
2.23.1 | 3 | 11/25/2024 |
2.23.0 | 3 | 10/09/2024 |
2.22.0 | 5 | 03/03/2024 |
2.21.0 | 3 | 10/09/2024 |
2.20.0 | 4 | 10/09/2024 |
2.19.2 | 3 | 10/09/2024 |
2.19.1 | 3 | 05/22/2023 |
2.19.0 | 2 | 11/25/2024 |
2.18.0 | 5 | 12/02/2022 |
2.17.1 | 4 | 09/14/2022 |
2.17.0 | 2 | 11/25/2024 |
2.16.1 | 4 | 07/03/2022 |
2.16.0 | 3 | 10/05/2024 |
2.15.1 | 29 | 06/07/2022 |
2.15.0 | 6 | 03/11/2022 |
2.14.1 | 47 | 12/28/2021 |
2.14.0 | 3 | 10/04/2024 |
2.14.0-beta1 | 3 | 10/09/2024 |
2.13.3 | 4 | 10/09/2024 |
2.13.2 | 123 | 12/08/2021 |
2.13.1 | 75 | 01/13/2022 |
2.13.0 | 27 | 01/18/2022 |
2.13.0-beta1 | 2 | 11/25/2024 |
2.12.5 | 3 | 10/09/2024 |
2.12.4 | 6 | 02/25/2022 |
2.12.3 | 5 | 01/10/2022 |
2.12.2 | 3 | 10/09/2024 |
2.12.1 | 3 | 10/06/2024 |
2.12.0 | 3 | 10/09/2024 |
2.12.0-beta1 | 2 | 11/25/2024 |
2.11.6 | 60 | 12/07/2021 |
2.11.5 | 3 | 10/09/2024 |
2.11.4 | 3 | 11/25/2024 |
2.11.3 | 18 | 06/10/2022 |
2.11.2 | 4 | 10/09/2024 |
2.11.1 | 3 | 10/09/2024 |
2.11.0 | 2 | 11/25/2024 |
2.11.0-beta2 | 2 | 11/25/2024 |
2.11.0-beta1 | 3 | 10/09/2024 |
2.10.4 | 3 | 10/09/2024 |
2.10.3 | 3 | 10/09/2024 |
2.10.2 | 3 | 10/09/2024 |
2.10.1 | 4 | 10/09/2024 |
2.10.0 | 4 | 12/02/2022 |
2.10.0-beta1 | 3 | 10/09/2024 |
2.9.3 | 3 | 10/09/2024 |
2.9.2 | 3 | 10/09/2024 |
2.9.1 | 3 | 10/09/2024 |
2.9.0 | 3 | 10/09/2024 |
2.9.0-beta2 | 3 | 10/09/2024 |
2.9.0-beta1 | 3 | 10/09/2024 |
2.8.1 | 3 | 10/04/2024 |
2.8.0 | 2 | 10/05/2024 |
2.7.3 | 4 | 10/09/2024 |
2.7.2 | 3 | 10/09/2024 |
2.7.1 | 3 | 10/09/2024 |
2.7.0 | 2 | 11/25/2024 |
2.7.0-beta0001 | 3 | 10/09/2024 |
2.6.1 | 3 | 10/09/2024 |
2.6.0 | 3 | 10/09/2024 |
2.5.1 | 3 | 10/06/2024 |
2.5.0 | 3 | 10/09/2024 |
2.4.4 | 3 | 10/07/2024 |
2.4.3 | 2 | 11/25/2024 |
2.4.2 | 3 | 10/09/2024 |
2.4.1 | 4 | 10/09/2024 |
2.4.0 | 3 | 10/09/2024 |
2.4.0-beta1 | 3 | 10/09/2024 |
2.3.0 | 3 | 10/09/2024 |
2.3.0-rc1 | 4 | 10/09/2024 |
2.3.0-beta1 | 4 | 10/09/2024 |
2.2.4 | 3 | 10/09/2024 |
2.2.3 | 3 | 10/05/2024 |
2.2.2 | 3 | 10/09/2024 |
2.2.1 | 2 | 11/25/2024 |
2.2.0 | 3 | 10/09/2024 |
2.2.0-rc0 | 3 | 10/09/2024 |
2.1.1 | 2 | 11/25/2024 |
2.1.0 | 3 | 10/09/2024 |
2.1.0-rc1 | 3 | 10/09/2024 |
2.1.0-rc0 | 3 | 10/06/2024 |
2.0.2 | 3 | 10/09/2024 |
2.0.1 | 4 | 10/09/2024 |
2.0.0 | 3 | 10/09/2024 |
2.0.0-rc0 | 3 | 10/09/2024 |
2.0.0-beta4 | 3 | 10/09/2024 |
2.0.0-beta3 | 3 | 10/08/2024 |
2.0.0-beta2 | 2 | 10/05/2024 |
2.0.0-beta1 | 3 | 10/09/2024 |