127.0.0.1:6379> set k1 v1 OK 127.0.0.1:6379> get k1 "v1" 127.0.0.1:6379> hset user:001 id 11 uname li4 (integer) 2 127.0.0.1:6379> set k1 v1 OK 127.0.0.1:6379> expire k1 30 (integer) 1 127.0.0.1:6379> ttl k1 (integer) 26 127.0.0.1:6379> set k1 v1 OK 127.0.0.1:6379> set k2 v2 OK 127.0.0.1:6379> del count (integer) 0 127.0.0.1:6379> incr count (integer) 1 127.0.0.1:6379> multi OK 127.0.0.1:6379(TX)> set k1 v1 QUEUED 127.0.0.1:6379(TX)> set k2 v2 QUEUED 127.0.0.1:6379(TX)> set k3 v3 QUEUED 127.0.0.1:6379(TX)> incr count QUEUED 127.0.0.1:6379(TX)> exec 1) OK 2) OK 3) OK 4) (integer) 2 127.0.0.1:6379> get k3 "v3" 127.0.0.1:6379> get count "2" 127.0.0.1:6379> keys * 1) "user:001" 2) "k1" 3) "count" 4) "k3" 5) "k2" 127.0.0.1:6379> multi OK 127.0.0.1:6379(TX)> set k1 v11 QUEUED 127.0.0.1:6379(TX)> set k2 v22 QUEUED 127.0.0.1:6379(TX)> incr count QUEUED 127.0.0.1:6379(TX)> discard OK 127.0.0.1:6379> get count "2" 127.0.0.1:6379> get k2 "v2" 127.0.0.1:6379> set email zzyybs@126.com OK 127.0.0.1:6379> multi OK 127.0.0.1:6379(TX)> set k1 v111 QUEUED 127.0.0.1:6379(TX)> set k2 v222 QUEUED 127.0.0.1:6379(TX)> set k3 (error) ERR wrong number of arguments for 'set' command 127.0.0.1:6379(TX)> exec (error) EXECABORT Transaction discarded because of previous errors. 127.0.0.1:6379> get k1 "v1" 127.0.0.1:6379> get k2 "v2" 127.0.0.1:6379> get email "zzyybs@126.com" 127.0.0.1:6379> multi OK 127.0.0.1:6379(TX)> set k1 v1111 QUEUED 127.0.0.1:6379(TX)> set k2 v2222 QUEUED 127.0.0.1:6379(TX)> incr count QUEUED 127.0.0.1:6379(TX)> incr email QUEUED 127.0.0.1:6379(TX)> set k3 v3333 QUEUED 127.0.0.1:6379(TX)> exec 1) OK 2) OK 3) (integer) 3 4) (error) ERR value is not an integer or out of range 5) OK 127.0.0.1:6379> get k1 "v1111" 127.0.0.1:6379> get k2 "v2222" 127.0.0.1:6379> get k3 "v3333" 127.0.0.1:6379> get count "3"
127.0.0.1:6379> set k1 v1
OK
127.0.0.1:6379> get k1
"v1"
127.0.0.1:6379> hset user:001 id 11 uname li4
(integer) 2
127.0.0.1:6379> set k1 v1
OK
127.0.0.1:6379> expire k1 30
(integer) 1
127.0.0.1:6379> ttl k1
(integer) 26
127.0.0.1:6379> set k1 v1
OK
127.0.0.1:6379> set k2 v2
OK
127.0.0.1:6379> del count
(integer) 0
127.0.0.1:6379> incr count
(integer) 1
127.0.0.1:6379> multi
OK
127.0.0.1:6379(TX)> set k1 v1
QUEUED
127.0.0.1:6379(TX)> set k2 v2
QUEUED
127.0.0.1:6379(TX)> set k3 v3
QUEUED
127.0.0.1:6379(TX)> incr count
QUEUED
127.0.0.1:6379(TX)> exec
1) OK
2) OK
3) OK
4) (integer) 2
127.0.0.1:6379> get k3
"v3"
127.0.0.1:6379> get count
"2"
127.0.0.1:6379> keys *
1) "user:001"
2) "k1"
3) "count"
4) "k3"
5) "k2"
127.0.0.1:6379> multi
OK
127.0.0.1:6379(TX)> set k1 v11
QUEUED
127.0.0.1:6379(TX)> set k2 v22
QUEUED
127.0.0.1:6379(TX)> incr count
QUEUED
127.0.0.1:6379(TX)> discard
OK
127.0.0.1:6379> get count
"2"
127.0.0.1:6379> get k2
"v2"
127.0.0.1:6379> set email zzyybs@126.com
OK
127.0.0.1:6379> multi
OK
127.0.0.1:6379(TX)> set k1 v111
QUEUED
127.0.0.1:6379(TX)> set k2 v222
QUEUED
127.0.0.1:6379(TX)> set k3
(error) ERR wrong number of arguments for 'set' command
127.0.0.1:6379(TX)> exec
(error) EXECABORT Transaction discarded because of previous errors.
127.0.0.1:6379> get k1
"v1"
127.0.0.1:6379> get k2
"v2"
127.0.0.1:6379> get email
"zzyybs@126.com"
127.0.0.1:6379> multi
OK
127.0.0.1:6379(TX)> set k1 v1111
QUEUED
127.0.0.1:6379(TX)> set k2 v2222
QUEUED
127.0.0.1:6379(TX)> incr count
QUEUED
127.0.0.1:6379(TX)> incr email
QUEUED
127.0.0.1:6379(TX)> set k3 v3333
QUEUED
127.0.0.1:6379(TX)> exec
1) OK
2) OK
3) (integer) 3
4) (error) ERR value is not an integer or out of range
5) OK
127.0.0.1:6379> get k1
"v1111"
127.0.0.1:6379> get k2
"v2222"
127.0.0.1:6379> get k3
"v3333"
127.0.0.1:6379> get count
"3"
?