redis / ioredis

🚀 A robust, performance-focused, and full-featured Redis client for Node.js.
MIT License
14.31k stars 1.19k forks source link

`multi` promise fails along with `call` #1326

Open vorillaz opened 3 years ago

vorillaz commented 3 years ago

Hey there, thanks for this amazing project. I am having some hard times trying to use multi along with call. Although this example works as expected:

const final = await redis.multi().set('foo', 'bar').set('foo1', 'bar').exec();

When I am trying to apply the same syntax with a custom Redis module the promise chain is failing:

const final = await redis
    .multi()
    .call('BF.ADD', 'test', 'key')
    .call('BF.ADD', 'test', 'key1')
    .call('BF.ADD', 'test', 'key2')
    .exec();

The code above is tested against v4.25.0. Any ideas, tips, or suggestions will be highly appreciated.

RomainLt commented 2 years ago

Hello, I don't know if you still have the problem but the multi works with call for me to use the json module (ioredis v5) :

result = await this.redisClient
    .multi()
    .call('JSON.SET', 'key1', '.', '{"test": "cookie"}') // '.' is the root object
    .call('EXPIRE', 'key1', 60)
    .exec()