Redis Advanced icon

Redis Advanced

Get, send and update data in Redis with enhanced operations

String Length

AI-generated

Summary

Get the length of the string value stored at a specified Redis key.

Inputs

  • Key (required) — The name of the Redis key whose string length you want to retrieve.
  • Value Is JSON — Optional toggle shown only if the key type is 'hash'; specifies whether the value is JSON or key-value pairs. Not applicable for this operation.

Output shape

a single JSON object containing the key and the length of its string value

Outputs an object in the form { key: string, length: number }. If the key does not exist or is not a string, length will be 0 or Redis default behavior applies.

Examples

Example 1: Retrieve the length of a string stored under the key 'myStringKey'.

Set 'Key' to 'myStringKey', choose operation 'String Length'. The output will include the length of the string value at this key.

Discussion