MongoDB.Bson 3.0.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
Official .NET driver for MongoDB.
60
MongoDB.Driver.Core
Core Component of the Official MongoDB .NET Driver.
54
MongoDB.Driver
Official .NET driver for MongoDB.
48
MongoDB.Driver.Core
Core Component of the Official MongoDB .NET Driver.
44
MongoDB.Driver
Official .NET driver for MongoDB.
44
MongoDB.Driver.GridFS
GridFS Component of the Official MongoDB .NET Driver.
43
MongoDB.Driver.Core
Core Component of the Official MongoDB .NET Driver.
42
MongoDB.Driver
Official .NET driver for MongoDB.
42
MongoDB.Driver.GridFS
GridFS Component of the Official MongoDB .NET Driver.
41
MongoDB.Driver.Core
Core Component of the Official MongoDB .NET Driver.
41
MongoDB.Driver
Official .NET driver for MongoDB.
41
MongoDB.Driver.Core
Core Component of the Official MongoDB .NET Driver.
40
MongoDB.Driver
Official .NET driver for MongoDB.
40

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

Version Downloads Last updated
3.4.0 0 05/01/2025
3.3.0 7 03/28/2025
3.2.1 12 02/22/2025
3.2.0 12 02/13/2025
3.1.0 18 12/06/2024
3.0.0 19 10/19/2024
2.30.0 16 10/22/2024
2.29.0 20 09/19/2024
2.28.0 27 07/24/2024
2.27.0 27 06/30/2024
2.26.0 22 06/18/2024
2.25.0 29 04/13/2024
2.24.0 33 03/01/2024
2.23.2 30 03/01/2024
2.23.1 24 12/27/2023
2.23.0 24 12/21/2023
2.22.0 24 10/11/2023
2.21.0 41 08/19/2023
2.20.0 40 06/23/2023
2.19.2 38 05/25/2023
2.19.1 40 05/06/2023
2.19.0 38 08/04/2023
2.18.0 41 11/24/2022
2.17.1 34 11/26/2022
2.17.0 30 08/16/2023
2.16.1 37 08/04/2023
2.16.0 38 07/28/2022
2.15.1 31 08/15/2023
2.15.0 36 08/11/2023
2.14.1 43 09/24/2022
2.14.0 33 07/01/2022
2.14.0-beta1 36 08/15/2023
2.13.3 38 04/18/2023
2.13.2 40 08/03/2023
2.13.1 39 08/10/2022
2.13.0 34 11/01/2022
2.13.0-beta1 33 11/03/2022
2.12.5 36 08/04/2023
2.12.4 28 08/04/2023
2.12.3 44 08/23/2022
2.12.2 31 08/07/2023
2.12.1 34 09/14/2022
2.12.0 33 08/05/2023
2.12.0-beta1 29 10/30/2022
2.11.6 34 06/11/2022
2.11.5 36 06/13/2023
2.11.4 32 06/01/2023
2.11.3 33 08/09/2023
2.11.2 32 08/08/2023
2.11.1 36 08/07/2023
2.11.0 37 08/23/2022
2.11.0-beta2 37 08/15/2022
2.11.0-beta1 34 07/17/2023
2.10.4 38 08/03/2023
2.10.3 29 06/17/2023
2.10.2 31 06/19/2023
2.10.1 35 08/04/2023
2.10.0 32 06/22/2022
2.10.0-beta1 33 07/16/2023
2.9.3 31 07/15/2023
2.9.2 35 06/16/2023
2.9.1 41 11/01/2022
2.9.0 38 10/21/2022
2.9.0-beta2 32 08/07/2023
2.9.0-beta1 41 08/02/2023
2.8.1 29 09/22/2023
2.8.0 32 08/17/2023
2.7.3 41 09/02/2022
2.7.2 28 08/04/2023
2.7.1 34 10/02/2022
2.7.0 24 10/20/2023
2.7.0-beta0001 35 08/11/2023
2.6.1 31 07/08/2023
2.6.0 40 07/30/2023
2.5.1 37 08/14/2023
2.5.0 30 08/05/2023
2.4.4 30 08/11/2023
2.4.3 40 09/30/2022
2.4.2 40 09/20/2022
2.4.1 36 08/08/2023
2.4.0 55 10/08/2022
2.4.0-beta1 41 10/27/2022
2.3.0 37 08/05/2023
2.3.0-rc1 33 08/11/2023
2.3.0-beta1 39 08/06/2023
2.2.4 35 10/13/2022
2.2.3 30 08/15/2022
2.2.2 40 02/09/2023
2.2.1 34 10/16/2022
2.2.0 31 08/10/2023
2.2.0-rc0 35 08/11/2023
2.1.1 38 08/16/2023
2.1.0 36 08/19/2023
2.1.0-rc1 31 08/16/2023
2.1.0-rc0 36 08/19/2023
2.0.2 32 08/22/2023
2.0.1 36 11/13/2022
2.0.0 40 09/14/2022
2.0.0-rc0 31 08/18/2023
2.0.0-beta4 37 09/18/2022
2.0.0-beta3 37 09/05/2022
2.0.0-beta2 27 08/24/2023
2.0.0-beta1 38 11/21/2022