MongoDB.Driver.Core 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.Core.
Packages | Downloads |
---|---|
MongoDB.Driver.GridFS
GridFS Component of the Official MongoDB .NET Driver.
|
481 |
MongoDB.Driver
Official .NET driver for MongoDB.
|
185 |
MongoDB.Driver
Official .NET driver for MongoDB.
|
177 |
MongoDB.Driver.GridFS
GridFS Component of the Official MongoDB .NET Driver.
|
176 |
Flowaccount.Data
Application Core
|
98 |
Flowaccount.Data
Application Core
|
62 |
Flowaccount.Data
Application Core
|
53 |
Flowaccount.Data
Application Core
|
51 |
MongoDB.Driver
Official .NET driver for MongoDB.
|
50 |
Flowaccount.Data
Application Core
|
49 |
Flowaccount.Data
Application Core
|
44 |
Flowaccount.Data
Application Core
|
43 |
MongoDB.Driver
Official .NET driver for MongoDB.
|
39 |
Flowaccount.Data
Application Core
|
37 |
MongoDB.Driver.GridFS
GridFS Component of the Official MongoDB .NET Driver.
|
37 |
Flowaccount.Data
Application Core
|
35 |
https://github.com/mongodb/mongo-csharp-driver/releases/tag/v2.28.0
.NET Framework 4.7.2
- MongoDB.Bson (>= 2.28.0)
- AWSSDK.SecurityToken (>= 3.7.100.14)
- DnsClient (>= 1.6.1)
- Microsoft.Extensions.Logging.Abstractions (>= 2.0.0)
- MongoDB.Libmongocrypt (>= 1.11.0)
- SharpCompress (>= 0.30.1)
- Snappier (>= 1.0.0)
- System.Net.Http (>= 4.3.4)
- System.Runtime.InteropServices.RuntimeInformation (>= 4.3.0)
- ZstdSharp.Port (>= 0.7.3)
- System.Buffers (>= 4.5.1)
.NET Standard 2.1
- ZstdSharp.Port (>= 0.7.3)
- System.Buffers (>= 4.5.1)
- Snappier (>= 1.0.0)
- SharpCompress (>= 0.30.1)
- MongoDB.Libmongocrypt (>= 1.11.0)
- Microsoft.Extensions.Logging.Abstractions (>= 2.0.0)
- DnsClient (>= 1.6.1)
- AWSSDK.SecurityToken (>= 3.7.100.14)
- MongoDB.Bson (>= 2.28.0)
.NET Standard 2.0
- ZstdSharp.Port (>= 0.7.3)
- System.Buffers (>= 4.5.1)
- Snappier (>= 1.0.0)
- MongoDB.Libmongocrypt (>= 1.11.0)
- SharpCompress (>= 0.30.1)
- DnsClient (>= 1.6.1)
- Microsoft.Extensions.Logging.Abstractions (>= 2.0.0)
- MongoDB.Bson (>= 2.28.0)
- AWSSDK.SecurityToken (>= 3.7.100.14)
Version | Downloads | Last updated |
---|---|---|
2.30.0 | 2 | 10/21/2024 |
2.29.0 | 2 | 09/24/2024 |
2.28.0 | 3 | 07/24/2024 |
2.27.0 | 7 | 06/28/2024 |
2.26.0 | 3 | 06/25/2024 |
2.25.0 | 3 | 04/30/2024 |
2.24.0 | 4 | 03/14/2024 |
2.23.2 | 11 | 03/14/2024 |
2.23.1 | 4 | 12/21/2023 |
2.23.0 | 8 | 12/15/2023 |
2.22.0 | 6 | 12/15/2023 |
2.21.0 | 5 | 01/13/2024 |
2.20.0 | 10 | 08/16/2023 |
2.19.2 | 7 | 08/28/2023 |
2.19.1 | 36 | 04/24/2023 |
2.19.0 | 20 | 08/26/2023 |
2.18.0 | 21 | 10/18/2022 |
2.17.1 | 6 | 08/11/2022 |
2.17.0 | 5 | 02/18/2024 |
2.16.1 | 6 | 08/29/2023 |
2.16.0 | 5 | 08/30/2023 |
2.15.1 | 6 | 08/30/2023 |
2.15.0 | 7 | 08/25/2023 |
2.14.1 | 11 | 12/15/2021 |
2.14.0 | 6 | 08/16/2022 |
2.14.0-beta1 | 6 | 08/29/2023 |
2.13.3 | 7 | 08/31/2023 |
2.13.2 | 8 | 08/31/2023 |
2.13.1 | 5 | 08/26/2023 |
2.13.0 | 5 | 08/16/2023 |
2.13.0-beta1 | 7 | 09/01/2023 |
2.12.5 | 10 | 08/27/2023 |
2.12.4 | 10 | 08/31/2023 |
2.12.3 | 6 | 08/30/2023 |
2.12.2 | 6 | 08/24/2023 |
2.12.1 | 9 | 08/30/2023 |
2.12.0 | 7 | 08/15/2022 |
2.12.0-beta1 | 8 | 08/24/2023 |
2.11.6 | 6 | 08/29/2023 |
2.11.5 | 8 | 08/30/2023 |
2.11.4 | 8 | 08/28/2023 |
2.11.3 | 7 | 08/28/2023 |
2.11.2 | 7 | 09/02/2023 |
2.11.1 | 6 | 08/24/2023 |
2.11.0 | 61 | 06/23/2021 |
2.11.0-beta2 | 5 | 08/29/2023 |
2.11.0-beta1 | 9 | 01/16/2021 |
2.10.4 | 38 | 07/02/2020 |
2.10.3 | 5 | 08/29/2023 |
2.10.2 | 7 | 08/29/2023 |
2.10.1 | 6 | 08/25/2023 |
2.10.0 | 4 | 08/26/2023 |
2.10.0-beta1 | 9 | 08/28/2023 |
2.9.3 | 4 | 06/14/2023 |
2.9.2 | 6 | 02/18/2024 |
2.9.1 | 6 | 02/18/2024 |
2.9.0 | 6 | 06/13/2023 |
2.9.0-beta2 | 5 | 02/15/2024 |
2.9.0-beta1 | 4 | 02/15/2024 |
2.8.1 | 5 | 06/14/2023 |
2.8.0 | 4 | 12/21/2023 |
2.7.3 | 6 | 02/18/2024 |
2.7.2 | 7 | 06/14/2023 |
2.7.1 | 7 | 06/14/2023 |
2.7.0 | 5 | 02/18/2024 |
2.7.0-beta0001 | 4 | 08/27/2023 |
2.6.1 | 148 | 11/15/2019 |
2.6.0 | 7 | 02/18/2024 |
2.5.1 | 8 | 02/18/2024 |
2.5.0 | 39 | 11/29/2019 |
2.4.4 | 168 | 11/14/2019 |
2.4.3 | 5 | 02/18/2024 |
2.4.2 | 5 | 02/18/2024 |
2.4.1 | 5 | 02/18/2024 |
2.4.0 | 4 | 02/18/2024 |
2.4.0-beta1 | 6 | 02/15/2024 |
2.3.0 | 7 | 03/06/2020 |
2.3.0-rc1 | 5 | 08/28/2023 |
2.3.0-beta1 | 5 | 02/15/2024 |
2.2.4 | 4 | 06/13/2023 |
2.2.3 | 8 | 02/18/2024 |
2.2.2 | 5 | 02/18/2024 |
2.2.1 | 4 | 02/18/2024 |
2.2.0 | 7 | 02/18/2024 |
2.2.0-rc0 | 2 | 02/18/2024 |
2.1.1 | 3 | 02/18/2024 |
2.1.0 | 7 | 02/18/2024 |
2.1.0-rc1 | 3 | 08/28/2023 |
2.1.0-rc0 | 2 | 02/18/2024 |
2.0.2 | 5 | 02/18/2024 |
2.0.1 | 4 | 06/14/2023 |
2.0.0 | 5 | 02/18/2024 |
2.0.0-rc0 | 7 | 05/17/2023 |
2.0.0-beta4 | 7 | 02/15/2024 |
2.0.0-beta3 | 6 | 02/15/2024 |
2.0.0-beta2 | 5 | 02/15/2024 |
2.0.0-beta1 | 5 | 02/15/2024 |