Redix LogoDocumentation
API ReferenceLists

Overview

Lists are ordered collections of strings in Redix. They are perfect for implementing queues, stacks, message logs, and any scenario where you need to maintain an ordered sequence of elements.

Available Operations

Push Operations

  • LPush - Push to the left (head) of list
  • RPush - Push to the right (tail) of list

Pop Operations

  • LPop - Pop from the left (head) of list
  • RPop - Pop from the right (tail) of list

Access Operations

  • LRange - Get a range of elements
  • LLength - Get the length of a list
  • LIndex - Get element by index

Modification Operations

  • LSet - Set value at index
  • LTrim - Trim list to specified range
  • LRemove - Remove elements by value

Use Cases

  • Task queues (FIFO with RPush/LPop)
  • Stacks (LIFO with LPush/LPop)
  • Chat history
  • Activity logs
  • Undo/Redo systems

Quick Example

local Redix = exports.redix:GetInterface()

-- Add tasks to queue
Redix.RPush('queue:tasks', {task = 'process_order', id = 123})

-- Process from queue
Redix.LPop('queue:tasks', function(err, task)
    ProcessTask(task)
end)