You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
rstam dff7de8a1f CSHARP-2221: Update JSON driven transaction tests. 7 years ago
Docs Updated version number in a few more places from 2.5 to 2.6. 7 years ago
Release Notes Added release notes from other branches. 7 years ago
Tools Upgrade build.ps1 because latest version of CAKE broke the build. 8 years ago
build Update NETStandard.Library dependency to 1.6.1 to match DnsClient. 8 years ago
evergreen CSHARP-2290: Add 4.0 server to Evergreen matrix 7 years ago
src CSHARP-2221: Update JSON driven transaction tests. 7 years ago
tests CSHARP-2221: Update JSON driven transaction tests. 7 years ago
.gitattributes The MongoDB.Bson.dll and MongoDB.Driver.dll are now strongly named. They are signed using a TemporaryKeyPair. Official binaries will be resigned using a different strong name key. 14 years ago
.gitignore CSHARP-2123: Round up to the next highest integral maxTimeMS instead of truncating. 8 years ago
CONTRIBUTING.md CSHARP-578: added contributing doc. 13 years ago
CSharpDriver.Dotnet.sln CSHARP-2044: Migrate project.json files to .csproj 8 years ago
CSharpDriver.sln CSHARP-1564: Build and test MongoDB.Driver.Legacy against .NET Core. 9 years ago
GitVersion.yml Changed next version number from 2.5.1 to 2.7.0. 7 years ago
License.rtf fixing up some extra 10gen related text. 11 years ago
License.txt Updated copyrights to 20xx-present. 8 years ago
MongoDB.ruleset Reorganize solution directory into src and tests subdirectories. 9 years ago
MongoDBLegacy.ruleset Reorganize solution directory into src and tests subdirectories. 9 years ago
README.md CSHARP-2123: Round up to the next highest integral maxTimeMS instead of truncating. 8 years ago
build.cake CSHARP-2273: Index.html must be renamed index.html (lowercase). 7 years ago
build.cmd CSHARP-1707: Modify build scripts to also build and test against .NET Core. 9 years ago
build.ps1 Upgrade build.ps1 because latest version of CAKE broke the build. 8 years ago
build.sh CSHARP-1745: fixed issue with serialization when projecting an embedded array. 9 years ago
buildhelpers.cake Updated copyrights to 20xx-present. 8 years ago
uuidhelpers.js Added uuidhelpers.js file with Javascript helper functions to work with the various encoding of UUIDs in the mongo shell. These will eventually be obsoleted when SERVER-3153 is implemented. 14 years ago

README.md

MongoDB C# Driver

You can get the latest stable release from the official Nuget.org feed or from our github releases page.

If you'd like to work with the bleeding edge, you can use our custom feed. Some packages on this feed are pre-release and, while they've passed all our tests, are not yet ready for production.

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.

Maintainers:

Contributors:

If you have contributed and we have neglected to add you to this list please contact one of the maintainers to be added to the list (with apologies).