Skip to content

techybolek/mongo-csharp-driver

This branch is 1666 commits behind mongodb/mongo-csharp-driver:main.

Folders and files

NameName
Last commit message
Last commit date
May 17, 2018
May 17, 2018
Sep 20, 2017
Dec 12, 2017
Apr 20, 2018
May 17, 2018
May 17, 2018
Mar 3, 2011
Jan 7, 2018
Nov 8, 2012
Nov 27, 2017
Jul 13, 2016
Apr 20, 2018
Feb 19, 2014
Jan 4, 2018
Jun 8, 2016
Jun 8, 2016
Jan 7, 2018
Apr 21, 2018
Jul 25, 2016
Sep 20, 2017
Aug 17, 2016
Jan 4, 2018
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 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).

About

.NET Driver for MongoDB

Resources

License

Unknown, Unknown licenses found

Licenses found

Unknown
License.txt
Unknown
License.rtf

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 97.8%
  • Visual Basic .NET 2.1%
  • F# 0.1%
  • JavaScript 0.0%
  • PowerShell 0.0%
  • Shell 0.0%