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.
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"]);
}
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);
}
If you’ve identified a security vulnerability in a driver or any other MongoDB project, please report it according to the instructions here.
Please see our guidelines for contributing to the driver.
- Robert Stam [email protected]
- Craig Wilson [email protected]
- Bit Diffusion Limited [email protected]
- Alex Brown https://github.com/alexjamesbrown
- Justin Dearing [email protected]
- Dan DeBilt [email protected]
- Teun Duynstee [email protected]
- Einar Egilsson https://github.com/einaregilsson
- Ken Egozi [email protected]
- Daniel Goldman [email protected]
- Simon Green [email protected]
- Nik Kolev [email protected]
- Oleg Kosmakov [email protected]
- Brian Knight [email protected]
- Richard Kreuter [email protected]
- Kevin Lewis [email protected]
- Dow Liu [email protected]
- Alex Lyman [email protected]
- Alexander Nagy [email protected]
- Sridhar Nanjundeswaran https://github.com/sridharn
- Andrew Rondeau [email protected]
- Ed Rooth [email protected]
- Pete Smith [email protected]
- staywellandy https://github.com/staywellandy
- Testo [email protected]
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).