时间:2021-07-01 10:21:17 帮助过:4人阅读
[BEGIN] 2017/7/30 20:56:36
127.0.0.1:6379> lpush name "shi"
(integer) 1
127.0.0.1:6379> lpush name "san"
(integer) 2
127.0.0.1:6379> LRANGE name 0 -1
1) "san"
2) "shi"
127.0.0.1:6379> RPUSH name jun
(integer) 3
127.0.0.1:6379> LRANGE name 0 -1
1) "san"
2) "shi"
3) "jun"
127.0.0.1:6379> LPUSHX name tianshi
(integer) 4
127.0.0.1:6379> LRANGE name 0 -1
1) "tianshi"
2) "san"
3) "shi"
4) "jun"
127.0.0.1:6379> LPUSHX name1 tianshi
(integer) 0
127.0.0.1:6379> RPUSHX name xiaoliu
(integer) 5
127.0.0.1:6379> LRANGE name 0 -1
1) "tianshi"
2) "san"
3) "shi"
4) "jun"
5) "xiaoliu"
127.0.0.1:6379> RPUSHX name1 xiaoliu
(integer) 0
127.0.0.1:6379> LLEN name1
(integer) 0
127.0.0.1:6379> LLEN name
(integer) 5
127.0.0.1:6379> LINSERT name after shi 111
(integer) 6
127.0.0.1:6379> LRANGE name 0 -1
1) "tianshi"
2) "san"
3) "shi"
4) "111"
5) "jun"
6) "xiaoliu"
127.0.0.1:6379> lset name 0 222
OK
127.0.0.1:6379> LRANGE name 0 -1
1) "222"
2) "san"
3) "shi"
4) "111"
5) "jun"
6) "xiaoliu"
127.0.0.1:6379> lrem name xiaoliu
(error) ERR wrong number of arguments for ‘lrem‘ command
127.0.0.1:6379> LREM name xiaoliu 1
(error) ERR value is not an integer or out of range
127.0.0.1:6379> LREM name xiaoliu 0
(error) ERR value is not an integer or out of range
127.0.0.1:6379> LRANGE name 0 -1
1) "222"
2) "san"
3) "shi"
4) "111"