Skip to content

PebblePad/mongo-csharp-driver

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

usingMongoDB.Bson;usingMongoDB.Driver;
varclient=newMongoClient("mongodb://localhost:27017");vardatabase=client.GetDatabase("foo");varcollection=database.GetCollection<BsonDocument>("bar");awaitcollection.InsertOneAsync(newBsonDocument("Name","Jack"));varlist=awaitcollection.Find(newBsonDocument("Name","Jack")).ToListAsync();foreach(vardocumentinlist){Console.WriteLine(document["Name"]);}

Typed Documents

usingMongoDB.Bson;usingMongoDB.Driver;
publicclassPerson{publicObjectIdId{get;set;}publicstringName{get;set;}}
varclient=newMongoClient("mongodb://localhost:27017");vardatabase=client.GetDatabase("foo");varcollection=database.GetCollection<Person>("bar");awaitcollection.InsertOneAsync(newPerson{Name="Jack"});varlist=awaitcollection.Find(x =>x.Name=="Jack").ToListAsync();foreach(varpersoninlist){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

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C#97.8%
  • Visual Basic .NET2.1%
  • F#0.1%
  • JavaScript0.0%
  • PowerShell0.0%
  • Shell0.0%