STRLEN
This page documents the preview (v2.21) version. Preview includes features under active development and is for development and testing only. For production, use the stable (v2024.1) version.
Synopsis
STRLEN key
This command finds the length of the string value that is associated with the given key.
- If
keyis associated with a non-string value, an error is raised. - If
keydoes not exist, 0 is returned.
Return value
Returns length of the specified string.
Examples
$ SET yugakey "string value"
"OK"
$ STRLEN yugakey
12
$ STRLEN undefined_key
0