/MongoHelper

C# .NET Core library that helps connecting to a MongoDB database and performing CRUD operations on it using the official driver

Primary LanguageC#MIT LicenseMIT

MongoHelper

C# .NET Core library that helps performing CRUD operations on a MongoDB database using the official MongoDB driver.

Install

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

Dependencies

Use

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