- Notifications
You must be signed in to change notification settings - Fork1.3k
The Official C# .NET Driver for MongoDB
License
NotificationsYou must be signed in to change notification settings
mongodb/mongo-csharp-driver
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
The official MongoDB .NET/C# driver.
The MongoDB .NET/C# driver followssemantic versioning since v3.0.0 of its releases.
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"]);}
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);}
If you’ve identified a security vulnerability in a driver or any other MongoDB project, please report it according to theinstructions here.
Please see ourguidelines for contributing to the driver.
Thank you toeveryone who has contributed to this project.
About
The Official C# .NET Driver for MongoDB
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.