Skip to main content

Documentation Index

Fetch the complete documentation index at: https://upstash.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

The `STRLEN“ command in Redis is used to find the length of the string value associated with a key. In Redis, keys can be associated with various data types, and one of these data types is the “string.” The STRLEN command specifically operates on keys that are associated with string values.

Arguments

key
string
required
The name of the Redis key.

Response

The length of the value.
await redis.set("key", "helloworld")
const length = await redis.strlen("key");
console.log(length); // 10