vakho papidze vakho papidze - 1 month ago 12
Node.js Question

node.js get data from redis cluster, with ioredis, zrange method not returns correct number of data

I use this:

redisClient.zrange(key, 1, 1)
and try to get all data by that key, but sometimes some data from list is missing, but when i check in redis data is there, also by c# client everything is ok.
Any ideas?

Answer

For zrange command, the index is zero-based. 0 is the index for the first element, and -1 is the index for the last element.

To get all data for the given key:

zrange key 0 -1