vjzning / redis

Automatically exported from code.google.com/p/redis
https://code.google.com/p/redis/
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

The order of keys #151

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

I add some keys as follows.
redis-cli set "id:0001" val1
redis-cli set "id:0002" val2
redis-cli set "id:0010" va1l0
redis-cli set "id:0020" val21

then I did this command
redis-cli keys "id:*"
results is 
id:0010 id:0001 id:0020 id:0002

I expected output as follows
id:0001 id:0002 id:0010 id:00020

I want to know why to become such a result.  
and I want to know how to get results which I hope.

I am using redis 1.2.1.

Thank you

Original issue reported on code.google.com by yuji2.mi...@gmail.com on 29 Jan 2010 at 9:48

GoogleCodeExporter commented 9 years ago
keys will return keys in random order for design. To take ordered elements 
please take a look at sorted sets.

Cheers,
Salvatore

Original comment by anti...@gmail.com on 24 Aug 2010 at 9:53