127.0.0.1:6379> set number 123 OK 127.0.0.1:6379> object encoding number "int" 127.0.0.1:6379> append number 4 (integer) 4 127.0.0.1:6379> object encoding number "raw"
**embstr → raw**
1 2 3 4 5 6 7 8 9 10
127.0.0.1:6379> set msg "hello world" OK 127.0.0.1:6379> object encoding msg "embstr" 127.0.0.1:6379> append 1 (error) ERR wrong number of arguments for'append'command 127.0.0.1:6379> append msg 1 (integer) 12 127.0.0.1:6379> object encoding msg "raw"
list 对象
转换一样是破坏上面那两个条件
但是新版的redis list 只有 quicklist, 下面去学习一下
哈希对象
转换一样是破坏上面那两个条件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
127.0.0.1:6379> hset prifile name "Tom" (integer) 1 127.0.0.1:6379> hset prifile age 25 (integer) 1 127.0.0.1:6379> hset prifile career "Progresser" (integer) 1 127.0.0.1:6379> object encoding prifile "ziplist" 127.0.0.1:6379> hset prifile time "11111111111111111111111111111111111111111111111111111111111111111111"" Invalid argument(s) 127.0.0.1:6379> hset prifile time "11111111111111111111111111111111111111111111111111111111111111111111" (integer) 1 127.0.0.1:6379> object encoding prifile "hashtable" 127.0.0.1:6379>