MongoDB.Bson 3.4.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.
210
MongoDB.Driver
Official .NET driver for MongoDB.
198
MongoDB.Driver.GridFS
GridFS Component of the Official MongoDB .NET Driver.
195
MongoDB.Driver.Core
Core Component of the Official MongoDB .NET Driver.
187
MongoDB.Driver.Core
Core Component of the Official MongoDB .NET Driver.
168
MongoDB.Driver.Core
Core Component of the Official MongoDB .NET Driver.
74
MongoDB.Driver
Official .NET driver for MongoDB.
66
MongoDB.Driver.Core
Core Component of the Official MongoDB .NET Driver.
53
MongoDB.Driver.Core
Core Component of the Official MongoDB .NET Driver.
52
MongoDB.Driver
Official .NET driver for MongoDB.
52
MongoDB.Driver
Official .NET driver for MongoDB.
48
MongoDB.Driver.GridFS
GridFS Component of the Official MongoDB .NET Driver.
47
MongoDB.Driver
Official .NET driver for MongoDB.
45
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.
37
mongocsharpdriver
This package contains the legacy driver. The new driver's package name is MongoDB.Driver
36

https://github.com/mongodb/mongo-csharp-driver/releases/tag/v3.4.0

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