Frcs6.Extensions.Caching.MongoDB 1.2.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package Frcs6.Extensions.Caching.MongoDB --version 1.2.4                
NuGet\Install-Package Frcs6.Extensions.Caching.MongoDB -Version 1.2.4                
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="Frcs6.Extensions.Caching.MongoDB" Version="1.2.4" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Frcs6.Extensions.Caching.MongoDB --version 1.2.4                
#r "nuget: Frcs6.Extensions.Caching.MongoDB, 1.2.4"                
#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 Frcs6.Extensions.Caching.MongoDB as a Cake Addin
#addin nuget:?package=Frcs6.Extensions.Caching.MongoDB&version=1.2.4

// Install Frcs6.Extensions.Caching.MongoDB as a Cake Tool
#tool nuget:?package=Frcs6.Extensions.Caching.MongoDB&version=1.2.4                

Frcs6.Extensions.Caching.MongoDB

NuGet CI/CD Coverage Mutation score

Distributed cache implemented with MongoDB using Official .NET driver for MongoDB.

This implementation is based on the official version for Sql Server and Redis available here.

Installation / Usage

Some examples are available here.

MongoCache injection

You cand inject Mongo cache using MongoCachingServicesExtensions.AddMongoCache method with one of these parameters :

  • ConnectionString.
  • MongoClientSettings.
  • IMongoClient.

MongoClientSettings can be useful if you need to pass a certificate. You can read the official Mongo documentation Enable TLS on a Connection.

Examples

With connection string
const string connectionString = "mongodb://localhost:27017";
builder.Services.AddMongoCache(connectionString, options =>
{
    options.DatabaseName = "MyCacheDatabase";
    options.CollectionName = "MyCacheCollection";
    options.RemoveExpiredDelay = TimeSpan.FromSeconds(10);
});
With MongoClientSettings
var cert = new X509Certificate2("client.p12", "mySuperSecretPassword");
var settings = new MongoClientSettings
{
   SslSettings = new SslSettings
   {
      ClientCertificates = new[] { cert }
   },
   UseTls = true
};

builder.Services.AddMongoCache(settings, options =>
{
    options.DatabaseName = "MyCacheDatabase";
    options.CollectionName = "MyCacheCollection";
    options.RemoveExpiredDelay = TimeSpan.FromSeconds(10);
});

MongoCacheOptions

  • DatabaseName: Name of the cache database (required).
  • CollectionName: Name of the cache collection (required).
  • AllowNoExpiration: Allow item without expiration (default false).
  • RemoveExpiredDelay: Delay between each cache clean (default null).

Removing expired elements

Removing expired elements is automatic. The only option you have to set is RemoveExpiredDelay.

If RemoveExpiredDelay is not set, cleaning will launch on each cache access (Get, Set, Refresh).

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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 is compatible.  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 is compatible.  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. 
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
4.0.0 0 11/18/2024
3.1.9 0 11/18/2024
3.1.8 53 10/21/2024
3.1.7 47 10/15/2024
3.1.6 45 10/15/2024
3.1.5 48 10/10/2024
3.1.4 48 10/9/2024
3.1.3 44 10/9/2024
3.1.2 48 9/30/2024
3.1.1 56 9/23/2024
3.1.0 59 9/19/2024
3.1.0-beta0002 40 9/18/2024
3.1.0-beta0001 51 9/17/2024
3.0.1 89 9/17/2024
3.0.0 80 9/17/2024
2.0.22 88 9/12/2024
2.0.21 82 9/12/2024
2.0.20 84 9/12/2024
2.0.19 85 9/12/2024
2.0.18 95 8/28/2024
2.0.17 112 8/27/2024
2.0.16 87 8/27/2024
2.0.15 85 8/27/2024
2.0.14 106 8/9/2024
2.0.13 101 8/9/2024
2.0.12 86 7/15/2024
2.0.11 76 7/15/2024
2.0.10 79 7/15/2024
2.0.9 81 7/15/2024
2.0.8 83 7/11/2024
2.0.7 80 7/11/2024
2.0.6 91 7/11/2024
2.0.5 84 7/11/2024
2.0.4 102 6/29/2024
2.0.3 97 6/29/2024
2.0.2 107 6/29/2024
2.0.1 116 6/3/2024
2.0.0 104 5/29/2024
1.2.4 104 5/27/2024
1.2.3 108 5/27/2024
1.2.2 108 5/27/2024
1.2.1 117 4/18/2024
1.2.0 105 4/18/2024
1.1.10 107 4/18/2024
1.1.9 100 4/2/2024
1.1.8 109 3/26/2024
1.1.7 104 3/26/2024
1.1.6 110 3/19/2024
1.1.5 111 3/19/2024
1.1.3 110 3/19/2024
1.1.2 107 3/19/2024
1.1.1 113 3/12/2024
1.1.0 133 3/10/2024
1.0.1 118 3/4/2024
1.0.0 115 3/3/2024
0.1.4 116 3/3/2024
0.1.3 112 3/2/2024
0.1.2 106 2/28/2024
0.1.1 99 2/28/2024
0.1.0 105 2/27/2024