这是redis中原有的数据:
1) "url:/doi/10.1002/anie.201601258/full"
2) "url:/doi/10.1002/anie.201601883/full"
3) "url:/doi/10.1002/anie.201600911/full"
4) "url:/doi/10.1002/anie.201509978/full"
5) "url:/doi/10.1002/anie.201601016/full"
6) "url:/doi/10.1002/anie.201600841/full"
7) "url:/doi/10.1002/anie.201511733/full"
8) "url:/doi/10.1002/anie.201600918/full"
9) "url:/doi/10.1002/anie.201601042/full"
10) "url:/doi/10.1002/anie.201601120/full"
11) "url:/doi/10.1002/anie.201602071/full"
12) "url:/doi/10.1002/anie.201509601/full"
13) "url:/doi/10.1002/anie.201511065/full"
14) "url:/doi/10.1002/anie.201601238/full"
15) "url:/doi/10.1002/anie.201510994/full"
16) "url:/doi/10.1002/anie.201601082/full"
17) "url:/doi/10.1002/anie.201509260/full"
18) "url:/doi/10.1002/anie.201601621/full"
19) "url:/doi/10.1002/anie.201510748/full"
20) "url:/doi/10.1002/anie.201601003/full"
Redis.set了三条数据,如下:
1) "url:/doi/10.1002/anie.201601258/full"
2) "url:/doi/10.1002/anie.201601883/full"
3) "url:/doi/10.1002/anie.201600911/full"
4) "url:http://www.peintopython.net/"
5) "url:/doi/10.1002/anie.201509978/full"
6) "url:http://www.brpreiss.com/books/opus7/html/book.html"
7) "url:/doi/10.1002/anie.201601016/full"
8) "url:/doi/10.1002/anie.201600841/full"
9) "url:/doi/10.1002/anie.201511733/full"
10) "url:/doi/10.1002/anie.201600918/full"
11) "url:/doi/10.1002/anie.201601042/full"
12) "url:/doi/10.1002/anie.201601120/full"
13) "url:/doi/10.1002/anie.201602071/full"
14) "url:/doi/10.1002/anie.201509601/full"
15) "url:http://www.pearsonhighered.com/educator/academic/product/0,,0130260363,00%2Ben-USS_01DBC.html"
16) "url:/doi/10.1002/anie.201511065/full"
17) "url:/doi/10.1002/anie.201601238/full"
18) "url:/doi/10.1002/anie.201510994/full"
19) "url:/doi/10.1002/anie.201601082/full"
20) "url:/doi/10.1002/anie.201509260/full"
21) "url:/doi/10.1002/anie.201601621/full"
22) "url:/doi/10.1002/anie.201510748/full"
23) "url:/doi/10.1002/anie.201601003/full"
但是穿插在里面,为什么?
刚学redis,请教。
習慣沉默2017-04-24 16:02:24
Set は定義上、順序付けされていません。プログラムがどのように保存されたとしても、元の順序が得られるとは考えるべきではありません。順序を指定したい場合は、List を使用します。