Developer.Cloud.Helper.MongoDB 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Developer.Cloud.Helper.MongoDB --version 1.0.0                
NuGet\Install-Package Developer.Cloud.Helper.MongoDB -Version 1.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Developer.Cloud.Helper.MongoDB" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Developer.Cloud.Helper.MongoDB --version 1.0.0                
#r "nuget: Developer.Cloud.Helper.MongoDB, 1.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Developer.Cloud.Helper.MongoDB as a Cake Addin
#addin nuget:?package=Developer.Cloud.Helper.MongoDB&version=1.0.0

// Install Developer.Cloud.Helper.MongoDB as a Cake Tool
#tool nuget:?package=Developer.Cloud.Helper.MongoDB&version=1.0.0                

This package can help you during when you are using MongoDB. In this version you can do a mimal CRUD version

  • Create a new record
  • Read records
  • Update records by filter
  • Delete records by filter

Insert

public void Create()
{
	MongoDB.Insert insert = new MongoDB.Insert(_connectionString, _dbName);

	for (int i = 0; i < 10; i++)
	{
		var item = new
			{
				Id = Guid.NewGuid(),
				CreatedOn = DateTime.UtcNow.Date,
				Idx = i,
			};

		string json = Newtonsoft.Json.JsonConvert.SerializeObject(item);

		insert.Run(_collectionName, json).Wait();
	}
}

Select

MongoDB.Select select = new MongoDB.Select(_connectionString, _dbName);
select.Run(_collectionName);

Update

public void Update()
{
	List<MongoDBFilterDTO> f = new List<MongoDBFilterDTO>();
	f.Add(new MongoDBFilterDTO() { Field = "Idx", Filter = TypeOfFilter.Lt, Value = 8 });
	f.Add(new MongoDBFilterDTO() { Field = "Idx", Filter = TypeOfFilter.Gt, Value = 4 });

	MongoDB.Update update = new MongoDB.Update(_connectionString, _dbName);
	var json = update.Run(_collectionName,
		"Idx",
		999,
		f);
}

Delete

	List<MongoDBFilterDTO> f = new List<MongoDBFilterDTO>();
	f.Add(new MongoDBFilterDTO() { Field = "Idx", Filter = TypeOfFilter.Gt, Value = 1 });
	f.Add(new MongoDBFilterDTO() { Field = "Id", Filter = TypeOfFilter.Eq, Value = "XYZ" });

	MongoDB.Delete delete = new MongoDB.Delete(_connectionString, _dbName);
	var json = delete.Run(_collectionName, f);
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.1 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2020.9.26.6 515 9/26/2020
2020.9.26.1 468 9/26/2020
1.0.0 506 9/26/2020