ZhangZhihui's Blog  

 

 

Overwrites part of the string stored at key, starting at the specified offset, for the entire length of value. If the offset is larger than the current length of the string at key, the string is padded with zero-bytes to make offset fit.

 

127.0.0.1:6379> SET model toyota
OK
127.0.0.1:6379> GET model
"toyota"
127.0.0.1:6379> GETRANGE model 0 2
"toy"
127.0.0.1:6379> SETRANGE model 0 2 l
(error) ERR wrong number of arguments for 'setrange' command
127.0.0.1:6379> SETRANGE model 3 seller
(integer) 9
127.0.0.1:6379> GET model
"toyseller"
127.0.0.1:6379> SETRANGE model 10 one
(integer) 13
127.0.0.1:6379> GET model
"toyseller\x00one"
127.0.0.1:6379> SETRANGE db 6 Redis
(integer) 11
127.0.0.1:6379> GET db
"\x00\x00\x00\x00\x00\x00Redis"

 

posted on 2024-01-14 17:00  ZhangZhihuiAAA  阅读(4)  评论(0编辑  收藏  举报