node-redis
node-redis copied to clipboard
ZREVRANGEBYSCORE
Hello, I can't find this method, how can I change the function? Zrevrangebyscore--Zrevrangebyscore--Zrevrangebyscore--Zrevrangebyscore
https://redis.io/commands/zrevrangebyscore/ "As of Redis version 6.2.0, this command is regarded as deprecated.
It can be replaced by ZRANGE with the REV and BYSCORE arguments when migrating or writing new code."
While it is true that ZREVRANGEBYSCORE has been deprecated, when using this library to connect to and older Redis 5 node, using
const items = await client.zRange(myKey, '+inf', 0, { BY: 'SCORE', REV: true })
will error with
[ErrorReply: ERR value is not an integer or out of range]
I can see two approaches:
- Modify the implementation of
ZRANGEin this library to automatically send aZREVRANGEBYSCOREcommand when connecting to older servers - Implement the deprecated
ZREVRANGEBYSCOREcommand in this library.
I am happy to do either, which would you recommend?