Redis Advanced icon

Redis Advanced

Get, send and update data in Redis with enhanced operations

Push

AI-generated

Summary

Push a data value into a Redis list either at the head or the tail (end) of the list.

Inputs

  • List (required) — Name of the Redis list to push data onto.
  • Data (required) — The data string to push on the list.
  • Tail — Boolean flag to indicate whether to push data at the tail (end) if true, or at the head (start) if false.

Output shape

A single item per input with the original input data passed through unchanged.

This operation returns the original input data as output without modification. The actual push command execution is performed using Redis RPUSH if Tail is true, or LPUSH if Tail is false.

Examples

Example 1: Push the string 'message' to the head of the Redis list called 'notifications'.

Set 'List' to 'notifications', 'Data' to 'message', and leave 'Tail' as false (default).

Example 2: Push the stringified JSON data to the tail of a Redis list 'events'.

Set 'List' to 'events', 'Data' to the JSON string, and 'Tail' to true.

Discussion