MongoDB.Driver 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.
Showing the top 20 packages that depend on MongoDB.Driver.
Packages | Downloads |
---|---|
mongocsharpdriver
This package contains the legacy driver. The new driver's package name is MongoDB.Driver
|
626 |
mongocsharpdriver
This package contains the legacy driver. The new driver's package name is MongoDB.Driver
|
204 |
mongocsharpdriver
This package contains the legacy driver. The new driver's package name is MongoDB.Driver
|
121 |
mongocsharpdriver
This package contains the legacy driver. The new driver's package name is MongoDB.Driver
|
87 |
Mongo2Go
Mongo2Go is a managed wrapper around the latest MongoDB binaries. It targets .NET Standard 2.0.
This Nuget package contains the executables of mongod, mongoimport and mongoexport v4.4.4 for Windows, Linux and macOS.
Mongo2Go has two use cases:
1. Providing multiple, temporary and isolated MongoDB databases for unit tests (or to be precise: integration tests)
2. Providing a quick to set up MongoDB database for a local developer environment
|
28 |
mongocsharpdriver
This package contains the legacy driver. The new driver's package name is MongoDB.Driver.
|
20 |
mongocsharpdriver
This package contains the legacy driver. The new driver's package name is MongoDB.Driver
|
20 |
mongocsharpdriver
This package contains the legacy driver. The new driver's package name is MongoDB.Driver
|
19 |
Volo.Abp.MongoDB
Package Description
|
19 |
mongocsharpdriver
This package contains the legacy driver. The new driver's package name is MongoDB.Driver.
|
19 |
mongocsharpdriver
This package contains the legacy driver. The new driver's package name is MongoDB.Driver
|
18 |
Volo.Abp.MongoDB
Package Description
|
18 |
mongocsharpdriver
This package contains the legacy driver. The new driver's package name is MongoDB.Driver.
|
18 |
https://github.com/mongodb/mongo-csharp-driver/releases/tag/v2.28.0
.NET Framework 4.7.2
- MongoDB.Bson (>= 2.28.0)
- MongoDB.Driver.Core (>= 2.28.0)
- Microsoft.Extensions.Logging.Abstractions (>= 2.0.0)
- MongoDB.Libmongocrypt (>= 1.11.0)
.NET Standard 2.0
- MongoDB.Bson (>= 2.28.0)
- MongoDB.Driver.Core (>= 2.28.0)
- Microsoft.Extensions.Logging.Abstractions (>= 2.0.0)
- MongoDB.Libmongocrypt (>= 1.11.0)
.NET Standard 2.1
- MongoDB.Bson (>= 2.28.0)
- MongoDB.Driver.Core (>= 2.28.0)
- Microsoft.Extensions.Logging.Abstractions (>= 2.0.0)
- MongoDB.Libmongocrypt (>= 1.11.0)
Version | Downloads | Last updated |
---|---|---|
3.0.0 | 0 | 10/16/2024 |
2.30.0 | 0 | 10/16/2024 |
2.29.0 | 4 | 09/21/2024 |
2.28.0 | 8 | 08/01/2024 |
2.27.0 | 6 | 07/04/2024 |
2.26.0 | 6 | 06/27/2024 |
2.25.0 | 8 | 04/23/2024 |
2.24.0 | 9 | 03/06/2024 |
2.23.2 | 9 | 03/03/2024 |
2.23.1 | 204 | 12/29/2023 |
2.23.0 | 8 | 12/29/2023 |
2.22.0 | 842 | 10/11/2023 |
2.21.0 | 8 | 11/16/2023 |
2.20.0 | 9 | 10/23/2023 |
2.19.2 | 11 | 06/03/2023 |
2.19.1 | 12 | 06/04/2023 |
2.19.0 | 14 | 06/04/2023 |
2.18.0 | 10 | 06/04/2023 |
2.17.1 | 11 | 06/04/2023 |
2.17.0 | 9 | 06/04/2023 |
2.16.1 | 266 | 06/22/2022 |
2.16.0 | 1,954 | 06/16/2022 |
2.15.1 | 15 | 06/04/2023 |
2.15.0 | 8 | 06/04/2023 |
2.14.1 | 11 | 06/04/2023 |
2.14.0 | 15 | 06/04/2023 |
2.14.0-beta1 | 10 | 06/04/2023 |
2.13.3 | 13 | 06/04/2023 |
2.13.2 | 2,250 | 11/12/2021 |
2.13.1 | 14 | 09/27/2021 |
2.13.0 | 13 | 06/04/2023 |
2.13.0-beta1 | 16 | 05/12/2021 |
2.12.5 | 13 | 06/04/2023 |
2.12.4 | 14 | 06/04/2023 |
2.12.3 | 944 | 05/12/2021 |
2.12.2 | 10 | 06/04/2023 |
2.12.1 | 12 | 06/04/2023 |
2.12.0 | 120 | 03/19/2021 |
2.12.0-beta1 | 10 | 06/04/2023 |
2.11.6 | 80 | 03/01/2021 |
2.11.5 | 581 | 12/16/2020 |
2.11.4 | 34 | 12/16/2020 |
2.11.3 | 12 | 06/04/2023 |
2.11.2 | 12 | 06/04/2023 |
2.11.1 | 12 | 06/04/2023 |
2.11.0 | 11 | 06/04/2023 |
2.11.0-beta2 | 14 | 06/04/2023 |
2.11.0-beta1 | 10 | 06/04/2023 |
2.10.4 | 13 | 06/04/2023 |
2.10.3 | 11 | 06/04/2023 |
2.10.2 | 10 | 06/04/2023 |
2.10.1 | 10 | 06/04/2023 |
2.10.0 | 10 | 06/04/2023 |
2.10.0-beta1 | 13 | 06/04/2023 |
2.9.3 | 11 | 06/04/2023 |
2.9.2 | 14 | 06/04/2023 |
2.9.1 | 12 | 06/04/2023 |
2.9.0 | 13 | 06/04/2023 |
2.9.0-beta2 | 13 | 06/04/2023 |
2.9.0-beta1 | 12 | 06/04/2023 |
2.8.1 | 43 | 01/18/2021 |
2.8.0 | 11 | 06/04/2023 |
2.7.3 | 11 | 06/04/2023 |
2.7.2 | 13 | 06/04/2023 |
2.7.1 | 19 | 06/04/2023 |
2.7.0 | 13 | 06/04/2023 |
2.7.0-beta0001 | 14 | 06/04/2023 |
2.6.1 | 11 | 06/04/2023 |
2.6.0 | 12 | 06/04/2023 |
2.5.1 | 12 | 06/04/2023 |
2.5.0 | 10 | 06/04/2023 |
2.4.4 | 10 | 06/04/2023 |
2.4.3 | 14 | 06/04/2023 |
2.4.2 | 10 | 06/04/2023 |
2.4.1 | 12 | 06/04/2023 |
2.4.0 | 14 | 06/04/2023 |
2.4.0-beta1 | 11 | 06/04/2023 |
2.3.0 | 10 | 06/04/2023 |
2.3.0-rc1 | 11 | 06/04/2023 |
2.3.0-beta1 | 13 | 06/04/2023 |
2.2.4 | 11 | 06/04/2023 |
2.2.3 | 13 | 06/04/2023 |
2.2.2 | 13 | 06/04/2023 |
2.2.1 | 12 | 06/04/2023 |
2.2.0 | 12 | 06/04/2023 |
2.2.0-rc0 | 13 | 06/04/2023 |
2.1.1 | 15 | 06/04/2023 |
2.1.0 | 14 | 06/04/2023 |
2.1.0-rc1 | 12 | 06/04/2023 |
2.1.0-rc0 | 11 | 06/04/2023 |
2.0.2 | 10 | 06/04/2023 |
2.0.1 | 10 | 06/04/2023 |
2.0.0 | 10 | 06/04/2023 |
2.0.0-rc0 | 10 | 06/04/2023 |
2.0.0-beta4 | 9 | 06/04/2023 |
2.0.0-beta3 | 11 | 06/04/2023 |
2.0.0-beta2 | 11 | 06/04/2023 |
2.0.0-beta1 | 12 | 06/04/2023 |