X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/aed57a31af3a2fdaf0b8175568442ade979c7530..4eddb121563a9e50cf2ee66e2a0ff7c186dd696a:/doc/SetrangeCommand.html diff --git a/doc/SetrangeCommand.html b/doc/SetrangeCommand.html new file mode 100644 index 00000000..1bd70b4e --- /dev/null +++ b/doc/SetrangeCommand.html @@ -0,0 +1,58 @@ + + + +
+ + + +Overwrites part of a string at key starting at the specified offset,for all the length of value.If the offset is over the old length of the string, the string is paddedwith zero bytes until needed. Non existing keys are considered likealready containing an empty string.+
+redis> set foo "Hello World" +OK +redis> setrange foo 6 "Redis" +(integer) 11 +redis> get foo +"Hello Redis" +Example of the zero padding behavior.
+redis> del foo +(integer) 1 +redis> setrange foo 10 bar +(integer) 13 +redis> get foo +"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00bar" +Note that the maximum offset that you can set is 536870911 as Redis Strings are limited to 512 megabytes. You can still create longer arrays of values using multiple keys.