English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Redis Setrange Command

Redis Strings (string)

The Redis Setrange command uses a specified string to overwrite the string value stored at the given key, starting from the offset.

Syntax

Basic Syntax of redis Setrange Command:

redis 127.0.0.1:6379> SETRANGE KEY_NAME OFFSET VALUE

Available Version

>= 2.2.0

Return Value

The length of the modified string.

Online Examples

redis 127.0.0.1:6379> SET key1 "Hello World"
OK
redis 127.0.0.1:6379> SETRANGE key1 6 "Redis"
(integer) 11
redis 127.0.0.1:6379> GET key1
"Hello Redis"

Redis Strings (string)