Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mongodb/mongo-csharp-driver
The Official C# .NET Driver for MongoDB
https://github.com/mongodb/mongo-csharp-driver
csharp csharp-library dotnet-framework mongodb nosql
Last synced: 6 days ago
JSON representation
The Official C# .NET Driver for MongoDB
- Host: GitHub
- URL: https://github.com/mongodb/mongo-csharp-driver
- Owner: mongodb
- License: apache-2.0
- Created: 2010-06-02T18:22:21.000Z (over 14 years ago)
- Default Branch: main
- Last Pushed: 2024-12-31T00:58:35.000Z (13 days ago)
- Last Synced: 2024-12-31T10:00:09.047Z (13 days ago)
- Topics: csharp, csharp-library, dotnet-framework, mongodb, nosql
- Language: C#
- Homepage: https://www.mongodb.com/docs/drivers/csharp/current/
- Size: 797 MB
- Stars: 3,161
- Watchers: 239
- Forks: 1,259
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Codeowners: CODEOWNERS
Awesome Lists containing this project
- awesome-csharp - MongoDB - Official MongoDB C# driver (Database Drivers)
- awesome-dotnet-cn - MongoDB - MongoDB官方C#驱动。 (数据库驱动)
- awesome-mongodb - mongo-csharp-driver - Official C# driver (Libraries / C#/.NET ###)
- awesome-dotnet-core - MongoDB.Driver - .NET Driver for MongoDB. (Frameworks, Libraries and Tools / Database Drivers)
- awesome-dotnet - MongoDB - Official MongoDB C# driver (Database Drivers)
- awesome-mongodb - mongo-csharp-driver - Official C# driver (Libraries / C#/.NET ###)
- my-awesome - mongo-csharp-driver - .NET Driver for MongoDB (C#)
- awesome-dot-dev - MongoDB - Official MongoDB C# driver (Database Drivers)
- awesome-list - MongoDB C# Driver - The .NET driver for MongoDB (Data Management & Processing / Database & Cloud Management)
- awsome-dotnet - MongoDB - Official MongoDB C# driver (Database Drivers)
- Awesome-Nuget-Packages - **MongoDB.Driver**
- fucking-awesome-dotnet-core - MongoDB.Driver - .NET Driver for MongoDB. (Frameworks, Libraries and Tools / Database Drivers)
- awesome-dotnet - MongoDB - Official MongoDB C# driver (Database Drivers)
- awesome-dotnet-core - MongoDB.Driver - .NET Driver for MongoDB. (Frameworks, Libraries and Tools / Database Drivers)
- awesome-dotnet-core - MongoDB.Driver - MongoDB的.NET驱动程序。 (框架, 库和工具 / 数据库驱动程序)
README
MongoDB C# Driver
=================You can get the latest stable release from the [official Nuget.org feed](https://www.nuget.org/packages/MongoDB.Driver) or from our [github releases page](https://github.com/mongodb/mongo-csharp-driver/releases).
Getting Started
---------------### Untyped Documents
```C#
using MongoDB.Bson;
using MongoDB.Driver;
``````C#
var client = new MongoClient("mongodb://localhost:27017");
var database = client.GetDatabase("foo");
var collection = database.GetCollection("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
```C#
using MongoDB.Bson;
using MongoDB.Driver;
``````C#
public class Person
{
public ObjectId Id { get; set; }
public string Name { get; set; }
}
``````C#
var client = new MongoClient("mongodb://localhost:27017");
var database = client.GetDatabase("foo");
var collection = database.GetCollection("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
-------------
* [MongoDB](https://www.mongodb.com/docs)
* [Documentation](https://www.mongodb.com/docs/drivers/csharp/current/)Questions/Bug Reports
---------------------
* [MongoDB Community Forum](https://www.mongodb.com/community/forums/tags/c/data/drivers-odms/7/dot-net)
* [Jira](https://jira.mongodb.org/browse/CSHARP)If you’ve identified a security vulnerability in a driver or any other MongoDB project, please report it according to the [instructions here](https://www.mongodb.com/docs/manual/tutorial/create-a-vulnerability-report).
Contributing
------------Please see our [guidelines](CONTRIBUTING.md) for contributing to the driver.
Thank you to [everyone](https://github.com/mongodb/mongo-csharp-driver/graphs/contributors) who has contributed to this project.