Redix LogoDocumentation
API ReferenceLists

LTrim

Trim a list to the specified range

Syntax

Redix.LTrim(key, start, stop)

Parameters

Prop

Type

Returns

Prop

Type

Examples

-- Keep only first 100 elements
Redix.LTrim('logs:recent', 0, 99)

-- Keep only last 50 elements
Redix.LLength('chat:history', function(err, length)
    if length > 50 then
        Redix.LTrim('chat:history', -50, -1)
    end
end)