Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • 10:54
    stale[bot] closed #1028
  • 07:25
    Gyakusetsu closed #1051
  • 07:25
    Gyakusetsu commented #1051
  • 06:40
    AVVS commented #1051
  • 06:36
    Gyakusetsu commented #1051
  • 06:32
    AVVS commented #1051
  • 05:33
    Gyakusetsu edited #1051
  • 05:32
    Gyakusetsu review_requested #1051
  • 05:32
    Gyakusetsu review_requested #1051
  • 05:31
    Gyakusetsu opened #1051
  • 01:24
    Gyakusetsu edited #1050
  • 01:22
    Gyakusetsu opened #1050
  • Jan 21 18:24
    technicallyfeasible opened #1049
  • Jan 20 02:49
    ethanresnick commented #1027
  • Jan 20 01:43
    stale[bot] closed #1027
  • Jan 19 18:47
    xtianus79 commented #1031
  • Jan 19 18:47
    stale[bot] unlabeled #1031
  • Jan 19 18:47
    xtianus79 commented #1031
  • Jan 19 16:59
    stale[bot] closed #1026
  • Jan 19 13:59
    barakplasma commented #1043
Christian Roy
I recommend you read this again and see if you missed anything...
Jason Shin
ok I will do that
@roychri a quick question, how do you listen to all these events using cli?
I just want to test this without ioredis
Christian Roy
redis-cli monitor will show them I think
Jason Shin
so when the key expires, what will be logged in redis-cli monitor?
Christian Roy
If the notifications are enabled, yes, I think so
Jason Shin
I've bascially enabled everything notify-keyspace-events AKExes
but still nothing shows up on neither redis-cli monitor and .subscribe('__keyspace@0__:expire', and .subscribe('__keyevent@0__:expire',
Christian Roy
AKE would have been enough, since A means all
ok, in another terminal try redis-cli set foo bar and you should see a notification show in monitor
because you have all notificatinos enables, it should fire when the key is set too
Jason Shin
yup, it shows up
1550540164.681845 [0] "set" "foo" "bar"
Christian Roy
That's not the event
that's your command
Maybe it does not show up in monitor. Try this:
redis-cli --csv psubscribe '__key*__:*'
Jason Shin
it's working
redis.on('message', async (channel, message) => {
    // Handle event
    console.log(channel, message);
Christian Roy
oh yeah, that's right. Sorry I did not noticed. I presumed you had read the doc and was using it the way it was described
If you want to send a batch of commands (e.g. > 5), you can use pipelining to queue the commands in memory and then send them to Redis all at once. This way the performance improves by 50%~300% (See benchmark section).
But where is the benchmark program?
The link has been unreachable.
Achmad Naufal Syafiq

hey suddenly i got this error message Ready check failed: NOAUTH Authentication required, there are few controller that use redis and all of them refer to the same class but this one controller is the only experiencing error,

this is how i setup my ioredis

const redis = new Redis({
port: process.env.REDISPORT, // Redis port
host: process.env.REDISHOST, // Redis host
family: process.env.REDISFAMILY, // 4 (IPv4) or 6 (IPv6)
password: "somepass", // i hardcoded this one
//password: process.env.REDISPASS,
db: 0

getRedis() => redis


Hi. I'm using it really well, but I have a question.

How can I use the mget command on a particular key slot in a cluster environment?

Dharmen Bavaria
Could someone help me with following thing: I want to use Set function to store key with data to get expired after 24 hours. I would really appreciate if someone could help me with this. I have this function set(key: KeyType, value: any, expiryMode?: string | any[], time?: number | string, setMode?: number | string): Promise<string>; but i dont get her what should expiryMode, time and set model here.
Christian Roy

@dharmenbavaria Follow the arguments as defined by redis itself.
If you look at https://redis.io/commands/set
you will see SET key value [expiration EX seconds|PX milliseconds] [NX|XX]

So you would call ioredis like this:
redis.set( 'mykey', 'myvalue', 'EX', (24*60*60) ); (24 hours)

You could also do this:
await redis.set( 'mkey', 'myvalue' );
await redis.expire( 'mykey', (24*60*60) );
Kevin Lee
hi, there, can anyone help on this? I am trying to connect to aws elasticache redis (one master, too rep), cluster mode disabled. should I use new Redis or new Redis.Cluster?
Igor Limansky
hello, can anyone please take a look? I'm trying to connect to redis-cluster deployed with kubedb and experiencing issues, any ideas are very welcome! thanks
Mohit Sharma
Hey needed some help with ioredis cluster connection
bion howard
where are set, get, hmset, multi, pipeline documented?
i only see usage examples in the readme, nothing in the api
Swayam Narain

quick question:

If I run two successive commands like so:

redis.set('key1', 'val1');
redis.set('key2', 'val2');

Does the second command get sent to redis only after the reply from the first command has been received by the server?
Or does the client send both commands concurrently, independent of the outcome of each other?

await redis.watch("KEY1");
const key1 = await redis.get("KEY1");
//  ~ reconnect happens, KEY1 changed externally  ~
await redis.multi().set("KEY1", `${key1}_modified`).exec();
// ~ KEY1 rewritten despite of watch
Should it be an issue? At least to make some note of it in docs.
Patryk Zajdler
Hello, is anyone here by any chance? :-D
I have a rather simple question... when using async / await syntax, do exceptions get thrown or rather returned?
Christian Roy