Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

The Official C# .NET Driver for MongoDB

License

NotificationsYou must be signed in to change notification settings

mongodb/mongo-csharp-driver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MongoDB.DriverDocumentationDocumentationLicense

The official MongoDB .NET/C# driver.

The MongoDB .NET/C# driver followssemantic versioning since v3.0.0 of its releases.

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 theinstructions here.

Contributing

Please see ourguidelines for contributing to the driver.

Thank you toeveryone who has contributed to this project.


[8]ページ先頭

©2009-2025 Movatter.jp