Frcs6.Extensions.Caching.MongoDB
2.0.18
See the version list below for details.
dotnet add package Frcs6.Extensions.Caching.MongoDB --version 2.0.18
NuGet\Install-Package Frcs6.Extensions.Caching.MongoDB -Version 2.0.18
<PackageReference Include="Frcs6.Extensions.Caching.MongoDB" Version="2.0.18" />
<PackageVersion Include="Frcs6.Extensions.Caching.MongoDB" Version="2.0.18" />
<PackageReference Include="Frcs6.Extensions.Caching.MongoDB" />
paket add Frcs6.Extensions.Caching.MongoDB --version 2.0.18
#r "nuget: Frcs6.Extensions.Caching.MongoDB, 2.0.18"
#:package Frcs6.Extensions.Caching.MongoDB@2.0.18
#addin nuget:?package=Frcs6.Extensions.Caching.MongoDB&version=2.0.18
#tool nuget:?package=Frcs6.Extensions.Caching.MongoDB&version=2.0.18
Frcs6.Extensions.Caching.MongoDB
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
- Add package Frcs6.Extensions.Caching.MongoDB.
- Inject Mongo cache using
MongoCachingServicesExtensions.AddMongoCache. - Use
IDistributedCachewhere you need it.
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 | Versions 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 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 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net6.0
- Microsoft.Extensions.Caching.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Options (>= 8.0.2)
- MongoDB.Driver (>= 2.28.0)
-
net8.0
- Microsoft.Extensions.Caching.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Options (>= 8.0.2)
- MongoDB.Driver (>= 2.28.0)
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 |
|---|---|---|
| 6.0.3 | 620 | 12/3/2025 |
| 6.0.2 | 618 | 12/3/2025 |
| 6.0.1 | 548 | 12/1/2025 |
| 6.0.0 | 547 | 12/1/2025 |
| 5.0.10 | 195 | 8/13/2025 |
| 5.0.9 | 139 | 8/3/2025 |
| 5.0.8 | 185 | 4/28/2025 |
| 5.0.7 | 177 | 4/28/2025 |
| 5.0.6 | 187 | 4/28/2025 |
| 5.0.5 | 181 | 4/1/2025 |
| 5.0.4 | 113 | 1/20/2025 |
| 5.0.3 | 110 | 1/16/2025 |
| 5.0.2 | 134 | 12/10/2024 |
| 5.0.1 | 146 | 12/4/2024 |
| 5.0.0 | 131 | 11/28/2024 |
| 4.0.0 | 132 | 11/18/2024 |
| 3.1.9 | 125 | 11/18/2024 |
| 3.1.8 | 97 | 10/21/2024 |
| 3.1.7 | 85 | 10/15/2024 |
| 3.1.6 | 84 | 10/15/2024 |
| 3.1.5 | 91 | 10/10/2024 |
| 3.1.4 | 88 | 10/9/2024 |
| 3.1.3 | 91 | 10/9/2024 |
| 3.1.2 | 87 | 9/30/2024 |
| 3.1.1 | 96 | 9/23/2024 |
| 3.1.0 | 92 | 9/19/2024 |
| 3.1.0-beta0002 | 75 | 9/18/2024 |
| 3.1.0-beta0001 | 81 | 9/17/2024 |
| 3.0.1 | 138 | 9/17/2024 |
| 3.0.0 | 140 | 9/17/2024 |
| 2.0.22 | 137 | 9/12/2024 |
| 2.0.21 | 146 | 9/12/2024 |
| 2.0.20 | 127 | 9/12/2024 |
| 2.0.19 | 133 | 9/12/2024 |
| 2.0.18 | 143 | 8/28/2024 |
| 2.0.17 | 162 | 8/27/2024 |
| 2.0.16 | 152 | 8/27/2024 |
| 2.0.15 | 128 | 8/27/2024 |
| 2.0.14 | 158 | 8/9/2024 |
| 2.0.13 | 145 | 8/9/2024 |
| 2.0.12 | 144 | 7/15/2024 |
| 2.0.11 | 121 | 7/15/2024 |
| 2.0.10 | 140 | 7/15/2024 |
| 2.0.9 | 141 | 7/15/2024 |
| 2.0.8 | 127 | 7/11/2024 |
| 2.0.7 | 122 | 7/11/2024 |
| 2.0.6 | 146 | 7/11/2024 |
| 2.0.5 | 134 | 7/11/2024 |
| 2.0.4 | 158 | 6/29/2024 |
| 2.0.3 | 148 | 6/29/2024 |
| 2.0.2 | 151 | 6/29/2024 |
| 2.0.1 | 157 | 6/3/2024 |
| 2.0.0 | 157 | 5/29/2024 |
| 1.2.4 | 148 | 5/27/2024 |
| 1.2.3 | 164 | 5/27/2024 |
| 1.2.2 | 152 | 5/27/2024 |
| 1.2.1 | 167 | 4/18/2024 |
| 1.2.0 | 146 | 4/18/2024 |
| 1.1.10 | 156 | 4/18/2024 |
| 1.1.9 | 140 | 4/2/2024 |
| 1.1.8 | 158 | 3/26/2024 |
| 1.1.7 | 159 | 3/26/2024 |
| 1.1.6 | 154 | 3/19/2024 |
| 1.1.5 | 169 | 3/19/2024 |
| 1.1.3 | 161 | 3/19/2024 |
| 1.1.2 | 149 | 3/19/2024 |
| 1.1.1 | 162 | 3/12/2024 |
| 1.1.0 | 180 | 3/10/2024 |
| 1.0.1 | 168 | 3/4/2024 |
| 1.0.0 | 175 | 3/3/2024 |
| 0.1.4 | 159 | 3/3/2024 |
| 0.1.3 | 161 | 3/2/2024 |
| 0.1.2 | 146 | 2/28/2024 |
| 0.1.1 | 139 | 2/28/2024 |
| 0.1.0 | 157 | 2/27/2024 |