Skip to main content

SETEX

Note

Official reference: SETEX.

Write a string with an expiration in seconds.

Syntax

SETEX key seconds value

The corresponding EX, PX or NX option of SET is also available.

Results

ReturnRowsContent
Update count--Returns 1 if successful; 0 otherwise. (Success when status is "OK")

Example

SETEX demo:message 60 hello