标签:
127.0.0.1:6379>set mykey 1
OK
127.0.0.1:6379> get mykey
"1"
127.0.0.1:6379> rpush mylist A
(integer)1
127.0.0.1:6379> rpush mylist B
(integer)2
127.0.0.1:6379> lpush mylist first
(integer)3
127.0.0.1:6379> lrange mylist 0
(error) ERR wrong number of arguments for‘lrange‘ command
127.0.0.1:6379> lrange mylist 0-1
1)"first"
2)"A"
3)"B"
127.0.0.1:6379> hmset user:100 username antirez birthyear 1977 verified 1
OK
127.0.0.1:6379> hget user:100 username
"antirez"
127.0.0.1:6379> hget user:1000
(error) ERR wrong number of arguments for‘hget‘ command
127.0.0.1:6379> hget user:1000 username
(nil)
127.0.0.1:6379> sadd myset 123
(integer)3
127.0.0.1:6379> smembers myset
1)"1"
2)"2"
3)"3"
127.0.0.1:6379> zadd hackers 1940"Alan Kay"
(integer)1
127.0.0.1:6379> zadd hackers 1950"Ala2n Kay"
(integer)1
127.0.0.1:6379> zadd hackers 1430"Al3n Kay"
(integer)1
127.0.0.1:6379> zrange hackers 0-1
1)"Al3n Kay"
2)"Alan Kay"
3)"Ala2n Kay"
127.0.0.1:6379> zrevrange hackers 0-1
1)"Ala2n Kay"
2)"Alan Kay"
3)"Al3n Kay"
标签:
原文地址:http://www.cnblogs.com/jingLongJun/p/4524126.html