Skip to main content

LREM

Note

Official reference: LREM.

Remove occurrences of an element.

Syntax

LREM key count element

Positive count removes from the head, negative from the tail, up to its absolute value. Zero removes every matching element.

Results

ReturnRowsContent
Update count--Number of removed elements.

Example

RPUSH demo:queue first second first
LREM demo:queue 1 first