MyGit

mongodb/mongo-csharp-driver

Fork: 1257 Star: 3145 (更新于 2024-11-06 09:59:53)

license: Apache-2.0

Language: C# .

The Official C# .NET Driver for MongoDB

最后发布版本: v2.29.0 ( 2024-09-19 07:54:58)

官方网址 GitHub网址

MongoDB C# Driver

You can get the latest stable release from the official Nuget.org feed or from our github releases page.

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.

Thank you to everyone who has contributed to this project.

最近版本更新:(数据更新于 2024-10-15 21:15:17)

2024-09-19 07:54:58 v2.29.0

2024-07-24 04:30:19 v2.28.0

2024-06-28 09:43:51 v2.27.0

2024-06-13 07:43:59 v2.26.0

2024-04-13 06:08:26 v2.25.0

2024-02-22 03:15:26 v2.24.0

2024-02-21 07:20:51 v2.23.2

2023-12-16 03:43:57 v2.23.1

2023-12-12 08:12:35 v2.23.0

2023-10-10 06:29:57 v2.22.0

主题(topics):

csharp, csharp-library, dotnet-framework, mongodb, nosql

mongodb/mongo-csharp-driver同语言 C#最近更新仓库

2024-11-19 11:38:46 jellyfin/jellyfin

2024-11-15 10:33:01 DigitalRuby/IPBan

2024-11-13 04:41:56 dotnet/runtime

2024-11-07 00:43:03 huiyadanli/RevokeMsgPatcher

2024-11-06 13:04:33 Pik-4/HsMod

2024-11-05 02:46:31 microsoft/PowerToys