MongoDB.Bson 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.Bson.

Packages Downloads
MongoDB.Driver.GridFS
GridFS Component of the Official MongoDB .NET Driver.
496
MongoDB.Driver
Official .NET driver for MongoDB.
206
MongoDB.Driver
Official .NET driver for MongoDB.
196
MongoDB.Driver.GridFS
GridFS Component of the Official MongoDB .NET Driver.
194
MongoDB.Driver.Core
Core Component of the Official MongoDB .NET Driver.
183
MongoDB.Driver.Core
Core Component of the Official MongoDB .NET Driver.
164
MongoDB.Driver.Core
Core Component of the Official MongoDB .NET Driver.
72
MongoDB.Driver
Official .NET driver for MongoDB.
64
MongoDB.Driver.Core
Core Component of the Official MongoDB .NET Driver.
51
MongoDB.Driver.Core
Core Component of the Official MongoDB .NET Driver.
50
MongoDB.Driver
Official .NET driver for MongoDB.
50
MongoDB.Driver
Official .NET driver for MongoDB.
47
MongoDB.Driver.GridFS
GridFS Component of the Official MongoDB .NET Driver.
46
MongoDB.Driver
Official .NET driver for MongoDB.
43
MongoDB.Driver.GridFS
GridFS Component of the Official MongoDB .NET Driver.
41
MongoDB.Driver.GridFS
GridFS Component of the Official MongoDB .NET Driver.
40
MongoDB.Driver
Official .NET driver for MongoDB.
34
mongocsharpdriver
This package contains the legacy driver. The new driver's package name is MongoDB.Driver
33

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
3.4.0 8 05/02/2025
3.3.0 12 03/31/2025
3.2.1 15 02/23/2025
3.2.0 11 02/18/2025
3.1.0 11 12/10/2024
3.0.0 16 10/17/2024
2.30.0 10 10/17/2024
2.29.0 15 09/19/2024
2.28.0 15 07/27/2024
2.27.0 31 06/28/2024
2.26.0 30 06/14/2024
2.25.0 21 04/25/2024
2.24.0 25 03/15/2024
2.23.2 19 03/19/2024
2.23.1 14 01/18/2024
2.23.0 13 01/18/2024
2.22.0 16 01/18/2024
2.21.0 15 01/20/2024
2.20.0 20 08/16/2023
2.19.2 20 03/19/2024
2.19.1 21 04/30/2023
2.19.0 31 03/27/2024
2.18.0 39 10/18/2022
2.17.1 17 08/11/2022
2.17.0 13 08/09/2024
2.16.1 18 08/27/2023
2.16.0 17 07/30/2024
2.15.1 17 05/15/2023
2.15.0 17 08/31/2023
2.14.1 24 12/15/2021
2.14.0 15 07/29/2024
2.14.0-beta1 12 08/31/2023
2.13.3 14 08/18/2024
2.13.2 14 09/24/2024
2.13.1 15 09/24/2024
2.13.0 16 08/16/2023
2.13.0-beta1 15 08/24/2023
2.12.5 11 08/04/2024
2.12.4 14 09/24/2024
2.12.3 17 07/12/2024
2.12.2 12 08/30/2023
2.12.1 12 08/09/2024
2.12.0 17 08/15/2022
2.12.0-beta1 13 08/25/2023
2.11.6 16 08/29/2023
2.11.5 17 01/13/2021
2.11.4 19 08/26/2023
2.11.3 19 12/10/2023
2.11.2 12 07/28/2024
2.11.1 16 08/26/2023
2.11.0 59 06/23/2021
2.11.0-beta2 14 08/30/2023
2.11.0-beta1 16 08/26/2023
2.10.4 46 06/18/2020
2.10.3 12 09/24/2024
2.10.2 17 08/31/2023
2.10.1 10 09/24/2024
2.10.0 17 07/26/2024
2.10.0-beta1 14 08/29/2023
2.9.3 14 06/14/2023
2.9.2 15 06/13/2023
2.9.1 11 06/12/2023
2.9.0 15 06/13/2023
2.9.0-beta2 16 08/31/2023
2.9.0-beta1 14 08/28/2023
2.8.1 13 06/12/2023
2.8.0 15 06/12/2023
2.7.3 14 06/12/2023
2.7.2 15 06/12/2023
2.7.1 15 06/13/2023
2.7.0 18 06/13/2023
2.7.0-beta0001 16 08/26/2023
2.6.1 156 11/15/2019
2.6.0 14 06/12/2023
2.5.1 15 06/13/2023
2.5.0 49 11/29/2019
2.4.4 170 11/14/2019
2.4.3 13 06/12/2023
2.4.2 13 06/14/2023
2.4.1 14 06/11/2023
2.4.0 17 06/12/2023
2.4.0-beta1 13 08/26/2023
2.3.0 59 11/29/2019
2.3.0-rc1 13 01/14/2024
2.3.0-beta1 17 08/29/2023
2.2.4 16 06/14/2023
2.2.3 13 06/13/2023
2.2.2 13 06/13/2023
2.2.1 15 06/12/2023
2.2.0 14 06/14/2023
2.2.0-rc0 16 09/03/2024
2.1.1 16 06/13/2023
2.1.0 13 06/12/2023
2.1.0-rc1 17 04/16/2024
2.1.0-rc0 12 02/18/2024
2.0.2 14 06/11/2023
2.0.1 15 06/12/2023
2.0.0 14 06/12/2023
2.0.0-rc0 14 08/02/2024
2.0.0-beta4 12 08/28/2023
2.0.0-beta3 16 08/30/2023
2.0.0-beta2 16 08/25/2023
2.0.0-beta1 13 08/29/2023