Redis Advanced icon

Redis Advanced

Get, send and update data in Redis with enhanced operations

Eval

AI-generated

Summary

Execute a Lua script on the Redis server with optional keys and arguments, returning the script's result.

Inputs

  • Script (required) — Lua script to execute on the Redis server.
  • Keys — Space-separated list of keys to pass to the script.
  • Arguments — Space-separated list of arguments to pass to the script.

Output shape

a single JSON object containing the script execution result under the 'result' key.

The output contains the direct result of the Lua script invocation. If the result is a bigint, it is converted to a Number. Errors during execution are handled based on the node's 'Continue on Fail' setting, and will appear as error messages in the output if enabled.

Examples

Example 1: Run a Lua script without keys or arguments to get the current server time.

Set 'Script' to a Lua snippet that returns redis.call('TIME'). Leave 'Keys' and 'Arguments' empty.

Example 2: Run a Lua script with keys and arguments.

Provide space-separated keys in 'Keys' and arguments in 'Arguments'. The script can access them as KEYS and ARGV arrays respectively.

Discussion