STRLEN
STRLEN key
- Available since:
- Redis Open Source 2.2.0
- Time complexity:
- O(1)
- ACL categories:
-
@read,@string,@fast, - Compatibility:
- Redis Enterprise and Redis Cloud compatibility
Returns the length of the string value stored at key. An error is returned when key holds a non-string value.
Examples
Redis Enterprise and Redis Cloud compatibility
| Redis Enterprise | Redis Cloud | Notes |
|---|---|---|
| ✅ Standard | ✅ Standard |
Return information
Integer reply: the length of the string stored at key, or 0 when the key does not exist.