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
                    
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="Dredis.Extensions.Storage.Mongo" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Dredis.Extensions.Storage.Mongo" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Dredis.Extensions.Storage.Mongo" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Dredis.Extensions.Storage.Mongo --version 1.0.0
                    
#r "nuget: Dredis.Extensions.Storage.Mongo, 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.
#:package Dredis.Extensions.Storage.Mongo@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Dredis.Extensions.Storage.Mongo&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Dredis.Extensions.Storage.Mongo&version=1.0.0
                    
Install as a Cake Tool

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) with NX/XX/default semantics
    • GET (GetAsync)
    • DEL (DeleteAsync)
    • EXISTS (ExistsAsync for single and multiple keys)
    • MGET (GetManyAsync)
    • MSET (SetManyAsync)
    • INCRBY (IncrByAsync)
  • Expiration / TTL

    • EXPIRE / PEXPIRE
    • TTL / PTTL
    • CleanUpExpiredKeysAsync
    • 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, ZSCORE
    • ZRANGEBYSCORE, ZINCRBY, ZCOUNT
    • ZRANK, ZREVRANK, ZREMRANGEBYSCORE
  • Streams

    • XADD, XDEL, XLEN, XTRIM, XRANGE, XREVRANGE, XREAD
    • XINFO STREAM, XINFO GROUPS, XINFO CONSUMERS
    • XSETID
    • XGROUP CREATE, XGROUP DESTROY, XGROUP SETID, XGROUP DELCONSUMER
    • XREADGROUP, 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.ADD
    • TDIGEST.QUANTILE, TDIGEST.CDF
    • TDIGEST.RANK, TDIGEST.REVRANK, TDIGEST.BYRANK, TDIGEST.BYREVRANK
    • TDIGEST.TRIMMED_MEAN, TDIGEST.MIN, TDIGEST.MAX, TDIGEST.INFO
  • TopK

    • TOPK.RESERVE, TOPK.ADD, TOPK.INCRBY
    • TOPK.QUERY, TOPK.COUNT, TOPK.LIST, TOPK.INFO
  • Vectors

    • VSET, VGET, VDIM, VDEL, VSIM, VSEARCH
  • TimeSeries

    • TS.CREATE, TS.ADD, TS.INCRBY, TS.DECRBY, TS.GET
    • TS.RANGE, TS.REVRANGE, TS.MRANGE, TS.MREVRANGE
    • TS.DEL, TS.INFO
  • JSON

    • JSON.SET (JsonSetAsync)
    • JSON.GET (JsonGetAsync) with multi-path support
    • JSON.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: configured MongoClient instance
  • databaseName (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.Mongo to 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 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. 
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
1.0.0 116 2/24/2026