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"
标签:Commands,GETRANGE,0.1,Redis,6379,127.0,model,x00,SETRANGE From: https://www.cnblogs.com/zhangzhihui/p/17963903