I am using Ruby on Rails to store keys into redis. There are more than 20000 keys under my hash. I tried to limit 10 while getting all. But the redis returning 11 instead of 10. Why its returning 11?
My hash,
127.0.0.1:6379> HLEN myhash
(integer) 14148
In the following example, am querying 4 records but returning 5 with corresponding values,
127.0.0.1:6379> HSCAN my_hash 0 match * count 4
1) "896"
2) 1) "player 1"
2) "{\"id\":\"13192\",\"name\":\"Ram\"}"
3) "player 2"
4) "{\"id\":\"5429\",\"name\":\"Gopal\"}"
5) "player 3"
6) "{\"id\":\"2614\",\"name\":\"Venu\"}"
7) "player 4"
8) "{\"id\":\"9645\",\"name\":\"Sam\"}"
9) "player 5"
10) "{\"id\":\"2358\",\"name\":\"Rohit\"}"
Why am getting 5 here?