fastify / fastify-redis

Plugin to share a common Redis connection across Fastify.
MIT License
198 stars 31 forks source link

Get keys by pattern #183

Closed anistark closed 1 year ago

anistark commented 1 year ago

Prerequisites

🚀 Feature Proposal

Redis allows fetching data by pattern search like KEYS pattern.

Requesting feature to support redis.get with wildcard support:

  1. key-* to search for keys-1, keys-qwerty, etc.
  2. key-? to search for keys-1, keys-2, ....

Motivation

Already supported by redis nodejs library.

Example code:

client.keys('key-*', function (err, keys) {
    ...
});

Example

Should look something like: fastify.redis.get('key-*')

Uzlopak commented 1 year ago

We dont add any get-method to the fastify.redis attribute. fastify.redis is a ioredis client. So you should be able to make all the calls you like.

anistark commented 1 year ago

We dont add any get-method to the fastify.redis attribute. fastify.redis is a ioredis client. So you should be able to make all the calls you like.

Got it. fastify.redis.keys("key-*) works 🎉