Redix LogoDocumentation
API ReferenceHashes

Overview

Hashes are maps between string field names and string values. They are perfect for representing objects with multiple attributes, such as user profiles, game entities, or configuration settings. Hashes are more memory-efficient than storing each field as a separate key.

Available Operations

Basic Operations

Numeric Operations

Use Cases

  • Player profiles with multiple attributes
  • Vehicle data storage
  • Configuration per entity
  • Statistics tracking
  • Object properties with many fields

Quick Example

local Redix = exports.redix:GetInterface()

-- Set player profile
Redix.HSetMultiple('player:123', {
    name = 'John',
    level = 50,
    money = 10000
})

-- Get all data
Redix.HGetAll('player:123', function(err, data)
    print('Name:', data.name, 'Level:', data.level)
end)

-- Increment field
Redix.HIncrementBy('player:123', 'money', 500)