分类: 系统运维
2012-09-14 09:14:14
redis 127.0.0.1:6379> lpush mylist "world" (integer) 1 redis 127.0.0.1:6379> lpush mylist "hello" (integer) 2 redis 127.0.0.1:6379> lrange mylist 0 -1 1) "hello" 2) "world" |
redis 127.0.0.1:6379> rpush mylist2 "world" (integer) 1 redis 127.0.0.1:6379> rpush mylist2 "hello" (integer) 2 redis 127.0.0.1:6379> lrange mylist2 0 -1 1) "hello" 2) "world" |
redis 127.0.0.1:6379> rpush mylist3 "world" (integer) 1 redis 127.0.0.1:6379> linsert mylist3 before "world" "hello" (integer) 2 redis 127.0.0.1:6379> lrange mylist3 0 -1 1) "hello" 2) "world" |
redis 127.0.0.1:6379> rpush mylist4 "hello" (integer) 1 redis 127.0.0.1:6379> lset mylist4 0 "world" OK redis 127.0.0.1:6379> lrange mylist4 0 -1 1) "world" |
redis 127.0.0.1:6379> rpush mylist5 "hello" (integer) 1 redis 127.0.0.1:6379> rpush mylist5 "hello" (integer) 1 redis 127.0.0.1:6379> lrem mylist5 1 "hello" (integer) 1 |
redis 127.0.0.1:6379> rpush mylist8 "one" (integer) 1 redis 127.0.0.1:6379> rpush mylist8 "two" (integer) 2 redis 127.0.0.1:6379> ltrim mylist8 1 -1 (integer) 1 redis 127.0.0.1:6379> lrange mylist5 1 "hello" (integer) 1 |
redis 127.0.0.1:6379> lrange mylist 0 -1 1) "hello" 2) "world" redis 127.0.0.1:6379> lpop mylist "hello" redis 127.0.0.1:6379> lrange mylist 0 -1 "world" redis 127.0.0.1:6379> |
redis 127.0.0.1:6379> lrange mylist2 0 -1 1) "hello" 2) "world" redis 127.0.0.1:6379> rpop mylist2 "world" redis 127.0.0.1:6379> lrange mylist2 0 -1 1) "hello" redis 127.0.0.1:6379> |
redis 127.0.0.1:6379> lrange mylist2 0 -1 1) "hello" 2) "world" redis 127.0.0.1:6379> rpop mylist2 "world" redis 127.0.0.1:6379> lrange mylist2 0 -1 1) "hello" redis 127.0.0.1:6379> |
redis 127.0.0.1:6379> lrange mylist5 0 -1 1) "three" 2) "foo" redis 127.0.0.1:6379> lindex mylist5 0 "three" redis 127.0.0.1:6379> lindex mylist5 1 "foo" redis 127.0.0.1:6379> |
redis 127.0.0.1:6379> llen mylist5 (integer) 2 redis 127.0.0.1:6379> |