C# .NET Core library that helps performing CRUD operations on a MongoDB database using the official MongoDB driver.
Get it from nuget.org (https://www.nuget.org/packages/MongoHelper/1.0.1) or install it using the package manager console: PM> Install-Package MongoHelper
- MongoDB.Driver (>= 2.4.0) (https://docs.mongodb.com/ecosystem/drivers/csharp/)
- NETStandard.Library (>= 1.6.0)
Create instance
MongoHelper mongo = new MongoHelper(string DbConnection)
Since the MongoHelper class implements IDisposable it can be used in a using statement aswell.
using(MongoHelper mongo = new MongoHelper(string DbConnection)) { ... }
Select Count
Select the count of all documents in "collection1"
int count = mongo.SelectCount("collection1")
Select count with filter criteria (string, object)
int count = mongo.SelectCount("collection1", "Key", "Value")
Select
Select One
Insert
Update
Delete Not yet implemented.
Builder