Skip to content

brantw/mongo-csharp-driver

This branch is 3171 commits behind rstam/mongo-csharp-driver:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

e39d633 · May 12, 2014
Apr 23, 2014
May 2, 2014
Apr 15, 2014
Apr 18, 2014
May 2, 2014
May 12, 2014
Mar 3, 2011
Aug 26, 2013
Nov 8, 2012
Feb 19, 2014
Feb 19, 2014
Mar 21, 2014
Apr 14, 2014
Nov 18, 2011

Repository files navigation

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 build feed. Packages on this feed are pre-release and, while they've passed all our tests, are not yet ready for production.

Build Status

Build Status

Getting Started

Untyped Documents

using MongoDB.Bson;
using MongoDB.Driver;
var client = new MongoClient("mongodb://localhost:27017");
var server = client.GetServer();
var database = server.GetDatabase("foo");
var collection = database.GetCollection("bar");

collection.Insert(new BsonDocument("Name", "Jack"));

foreach(var document in collection.FindAll())
{
	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 server = client.GetServer();
var database = server.GetDatabase("foo");
var collection = database.GetCollection<Person>("bar");

collection.Insert(new Person { Name = "Jack" });

foreach(var person in collection.FindAll())
{
	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 (in alphabetical order):

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).

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published