English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The Redis STRLEN command is used to get the length of the string value stored at the specified key. If the key does not store a string value, it returns an error.
Basic Syntax of Redis STRLEN Command
redis 127.0.0.1:6379> STRLEN KEY_NAME
>= 2.2.0
Length of the string value. Returns 0 when the key does not exist.
# Get the length of a string redis> SET mykey "Hello world" OK redis> STRLEN mykey (integer) 11 # Length of non-existing key is 0 redis> STRLEN nonexisting (integer) 0