Dredis.Extensions.Storage.Mongo
1.0.0
dotnet add package Dredis.Extensions.Storage.Mongo --version 1.0.0
NuGet\Install-Package Dredis.Extensions.Storage.Mongo -Version 1.0.0
<PackageReference Include="Dredis.Extensions.Storage.Mongo" Version="1.0.0" />
<PackageVersion Include="Dredis.Extensions.Storage.Mongo" Version="1.0.0" />
<PackageReference Include="Dredis.Extensions.Storage.Mongo" />
paket add Dredis.Extensions.Storage.Mongo --version 1.0.0
#r "nuget: Dredis.Extensions.Storage.Mongo, 1.0.0"
#:package Dredis.Extensions.Storage.Mongo@1.0.0
#addin nuget:?package=Dredis.Extensions.Storage.Mongo&version=1.0.0
#tool nuget:?package=Dredis.Extensions.Storage.Mongo&version=1.0.0
Dredis.Extensions.Storage.Mongo
A concrete implementation of Dredis.Abstractions.Storage for MongoDB.
Current implementation status
This package currently implements the following IKeyValueStore areas:
String basics
SET(SetAsync) withNX/XX/default semanticsGET(GetAsync)DEL(DeleteAsync)EXISTS(ExistsAsyncfor single and multiple keys)MGET(GetManyAsync)MSET(SetManyAsync)INCRBY(IncrByAsync)
Expiration / TTL
EXPIRE/PEXPIRETTL/PTTLCleanUpExpiredKeysAsync- Backed by MongoDB TTL indexes and active-key filtering for immediate logical expiration behavior
Hashes
HSET,HGET,HDEL,HGETALL
Lists
LPUSH/RPUSH(ListPushAsync)LPOP/RPOP(ListPopAsync)LRANGE(ListRangeAsync)LLEN(ListLengthAsync)LINDEX(ListIndexAsync)LSET(ListSetAsync)LTRIM(ListTrimAsync)
Sets
SADD,SREM,SMEMBERS,SCARD
Sorted sets
ZADD,ZREM,ZRANGE,ZCARD,ZSCOREZRANGEBYSCORE,ZINCRBY,ZCOUNTZRANK,ZREVRANK,ZREMRANGEBYSCORE
Streams
XADD,XDEL,XLEN,XTRIM,XRANGE,XREVRANGE,XREADXINFO STREAM,XINFO GROUPS,XINFO CONSUMERSXSETIDXGROUP CREATE,XGROUP DESTROY,XGROUP SETID,XGROUP DELCONSUMERXREADGROUP,XACK,XPENDING,XCLAIM
HyperLogLog
PFADD,PFCOUNT,PFMERGE
Bloom filter
BF.RESERVE,BF.ADD,BF.MADD,BF.EXISTS,BF.MEXISTS,BF.INFO
Cuckoo filter
CF.RESERVE,CF.ADD,CF.ADDNX,CF.INSERT,CF.INSERTNX,CF.EXISTS,CF.DEL,CF.COUNT,CF.INFO
TDigest
TDIGEST.CREATE,TDIGEST.RESET,TDIGEST.ADDTDIGEST.QUANTILE,TDIGEST.CDFTDIGEST.RANK,TDIGEST.REVRANK,TDIGEST.BYRANK,TDIGEST.BYREVRANKTDIGEST.TRIMMED_MEAN,TDIGEST.MIN,TDIGEST.MAX,TDIGEST.INFO
TopK
TOPK.RESERVE,TOPK.ADD,TOPK.INCRBYTOPK.QUERY,TOPK.COUNT,TOPK.LIST,TOPK.INFO
Vectors
VSET,VGET,VDIM,VDEL,VSIM,VSEARCH
TimeSeries
TS.CREATE,TS.ADD,TS.INCRBY,TS.DECRBY,TS.GETTS.RANGE,TS.REVRANGE,TS.MRANGE,TS.MREVRANGETS.DEL,TS.INFO
JSON
JSON.SET(JsonSetAsync)JSON.GET(JsonGetAsync) with multi-path supportJSON.DEL(JsonDelAsync)JSON.TYPE(JsonTypeAsync)JSON.STRLEN(JsonStrlenAsync)JSON.ARRLEN(JsonArrlenAsync)JSON.ARRAPPEND(JsonArrappendAsync)JSON.ARRINDEX(JsonArrindexAsync)JSON.ARRINSERT(JsonArrinsertAsync)JSON.ARRREM(JsonArrremAsync)JSON.ARRTRIM(JsonArrtrimAsync)JSON.MGET(JsonMgetAsync)- Full JSONPath support:
$,.property,[n],.*,[*]syntax
Quick start
using Dredis.Abstractions.Storage;
using Dredis.Extensions.Storage.Mongo;
using MongoDB.Driver;
var client = new MongoClient("mongodb://localhost:27017");
IKeyValueStore store = new MongoKeyValueStore(client, "dredis", "kvstore");
await store.SetAsync("hello", System.Text.Encoding.UTF8.GetBytes("world"), null, SetCondition.None);
var value = await store.GetAsync("hello");
Configuration
MongoKeyValueStore constructor:
mongoClient: configuredMongoClientinstancedatabaseName(default:dredis)collectionName(default:kvstore)
The collectionName value is used as a prefix for type-specific collections (for example: kvstore_hash, kvstore_list, kvstore_set, kvstore_zset).
Notes
- Key-type separation is implemented with dedicated Mongo collections for string/hash/list/set/sorted-set/stream/hyperloglog/bloom/cuckoo/tdigest/topk/vector/timeseries/json values.
- Cross-type key operations (
DEL,EXISTS,EXPIRE,PTTL, cleanup) account for all currently implemented types.
Publishing to NuGet
This repository includes a GitHub Actions workflow at .github/workflows/publish-nuget.yml.
- Triggers on published GitHub releases, version tags (
v*), and manual dispatch. - Builds, tests, packs, and publishes
Dredis.Extensions.Storage.Mongoto NuGet. - Uses NuGet Trusted Publishing (OIDC) via
NuGet/login@v1; no long-lived NuGet API key is required. - Requires a Trusted Publishing policy on nuget.org for this repository and workflow file (
publish-nuget.yml).
Third-party notice
- This project depends on the MongoDB .NET/C# Driver (
MongoDB.Driver). - MongoDB is a registered trademark of MongoDB, Inc.
- Copyright for MongoDB and the MongoDB .NET/C# Driver belongs to MongoDB, Inc.; see the package license terms for full details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Dredis.Abstractions.Storage (>= 1.0.0)
- MongoDB.Driver (>= 3.6.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 |
|---|---|---|
| 1.0.0 | 116 | 2/24/2026 |